{"id":396,"date":"2009-12-22T23:36:33","date_gmt":"2009-12-22T22:36:33","guid":{"rendered":"http:\/\/www.gennard.net\/blog\/?p=396"},"modified":"2009-12-22T23:36:33","modified_gmt":"2009-12-22T22:36:33","slug":"12-cobol-tips","status":"publish","type":"post","link":"http:\/\/www.gennard.net\/blog\/2009\/12\/12-cobol-tips\/","title":{"rendered":"12 Tips for using Micro Focus COBOL"},"content":{"rendered":"<h1>12 Tips for using Micro Focus COBOL<\/h1>\n<p>As it is close to Christmas and I wanted to do something with <b>12<\/b> in the title, I&#8217;ve thrown together some useful if not un-ordered list of 12 things tips using Micro Focus COBOL.<\/p>\n<p>Remember I am just a developer and just want to help fellow developers out \ud83d\ude42  so&#8230;<\/p>\n<h2>Merry Christmas!<\/h2>\n<p>and here is my list&#8230;<\/p>\n<ol>\n<li>Use DLLs\/Shared objects rather than .int code<\/li>\n<li>DLLs\/Shared objects can be preloaded using:<br \/>\n<code lang=\"cobol\">01 my-ptr procedure-pointer.<br \/>\nset my-ptr to entry \"sodllname\"<\/code><br \/>\n<b>Note; sodllname does not have the extension&#8230; let the runtime choose it for you!<\/b>\n<\/li>\n<li>Use a good development environment such as Visual Studio or on Unix use Eclipse offering if you have a workstation, otherwise I personally use vim\/gvim if terminal access is the only choce.<\/li>\n<li>Remember you have a great choice of platforms from Windows to Linux to a load Unix platforms, so choice is king. (did I say that&#8230;)<\/li>\n<li>Try using managed code (.Net) if you want to create <a href=\"http:\/\/en.wikipedia.org\/wiki\/Windows_Presentation_Foundation\">WPF<\/a>\/<a href=\"http:\/\/en.wikipedia.org\/wiki\/Windows_Forms\">WinForms <\/a>or use <a href=\"http:\/\/en.wikipedia.org\/wiki\/Windows_Communication_Foundation\">WCF<\/a><\/li>\n<li>Interopability is great, so if you see a <a href=\"http:\/\/supportline.microfocus.com\/Documentation\/books\/nx40\/dijaco.htm\">Java Class<\/a>,<a href=\"http:\/\/supportline.microfocus.com\/documentation\/books\/nx60\/lhcpro.htm\"> .Net Class, <\/a><a href=\"http:\/\/supportline.microfocus.com\/documentation\/books\/nx50ws03\/dmcwiz.htm\">COM object<\/a>, <a href=\"http:\/\/supportline.microfocus.com\/documentation\/books\/sx40\/printf.htm\">&#8216;C&#8217; function<\/a> or a Web Service&#8230; use it!  You can even mix unmanaged and managed applications..<\/li>\n<li>Avoid using the following if performance is key, as this really does help our code generator:<br \/>\n<code lang=\"text\">alter<br \/>\nperform thru<br \/>\nnext sentence<br \/>\nsegments<br \/>\ngo to section-name<br \/>\ngo to paragraph outside the current section<br \/>\n<\/code>\n<\/li>\n<li>Try to end your routine with a &#8220;stop run [returning..]&#8221; or &#8220;exit program [returning..]&#8221; or &#8220;goback [returning..]&#8221; as this gives our code generators a defined end to the routine, which really does help our code analysis\/generator<\/li>\n<li>Use comp-5, integers for speed in calculations or native .Net types in managed<\/li>\n<li>Use comp-x for portability (file formats etc..)<\/li>\n<li>Make your application more robust, use tracing in production systems, either our own CTF tracing or your own or third party&#8230; it will save your life one day! Use runtime routines to catch error and log them (<a href=\"http:\/\/supportline.microfocus.com\/documentation\/books\/sx40\/prcblr.htm\">CBL_ERROR_PROC<\/a>), ensure your programs shutdown cleanly always use <a href=\"http:\/\/supportline.microfocus.com\/documentation\/books\/sx40\/prcblr.htm\">CBL_EXIT_PROC<\/a>.<\/li>\n<li>Use the generator directive <i>nocheck<\/i> if you are happy your code is solid and want to a little more performance. ie: it turns off runtime bounds checking<\/li>\n<\/ol>\n<p>Further reading: <\/p>\n<li><a href=\"http:\/\/www.microfocus.com\/000\/20030701_008_tcm21-6189.pdf\">Coding for speed, size and portability<\/a><\/li>\n<li><a href=\"http:\/\/www.microfocus.com\/000\/Cobol-for-Eclipse-v2_FINAL_tcm21-23611.pdf\">Eclipse\/COBOL on Unix<\/a><\/li>\n<li><a href=http:\/\/www.microfocus.com\/000\/20050901-003a_tcm21-6055.pdf\">Newsletter about CTF<\/a><\/li>\n<li>For CTF_ APIs see CBL_CTF_ see <a href=\"http:\/\/supportline.microfocus.com\/documentation\/books\/nx50ws03\/rhcall17.htm\">library routines<\/a><\/li>\n<p>Yes.. its a bit of a mixed list.. but hey it may be of help!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>12 Tips for using Micro Focus COBOL As it is close to Christmas and I wanted to do something with 12 in the title, I&#8217;ve thrown together some useful if not un-ordered list of 12 things tips using Micro Focus &hellip; <a href=\"http:\/\/www.gennard.net\/blog\/2009\/12\/12-cobol-tips\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,32],"tags":[209,227],"_links":{"self":[{"href":"http:\/\/www.gennard.net\/blog\/wp-json\/wp\/v2\/posts\/396"}],"collection":[{"href":"http:\/\/www.gennard.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.gennard.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.gennard.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.gennard.net\/blog\/wp-json\/wp\/v2\/comments?post=396"}],"version-history":[{"count":0,"href":"http:\/\/www.gennard.net\/blog\/wp-json\/wp\/v2\/posts\/396\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.gennard.net\/blog\/wp-json\/wp\/v2\/media?parent=396"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.gennard.net\/blog\/wp-json\/wp\/v2\/categories?post=396"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.gennard.net\/blog\/wp-json\/wp\/v2\/tags?post=396"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}