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’ve thrown together some useful if not un-ordered list of 12 things tips using Micro Focus COBOL.
Remember I am just a developer and just want to help fellow developers out 🙂 so…
and here is my list…
- Use DLLs/Shared objects rather than .int code
- DLLs/Shared objects can be preloaded using:
01 my-ptr procedure-pointer.
set my-ptr to entry "sodllname"
Note; sodllname does not have the extension… let the runtime choose it for you!
- 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.
- 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…)
- Try using managed code (.Net) if you want to create WPF/WinForms or use WCF
- Interopability is great, so if you see a Java Class, .Net Class, COM object, ‘C’ function or a Web Service… use it! You can even mix unmanaged and managed applications..
- Avoid using the following if performance is key, as this really does help our code generator:
go to section-name
go to paragraph outside the current section
- Try to end your routine with a “stop run [returning..]” or “exit program [returning..]” or “goback [returning..]” as this gives our code generators a defined end to the routine, which really does help our code analysis/generator
- Use comp-5, integers for speed in calculations or native .Net types in managed
- Use comp-x for portability (file formats etc..)
- Make your application more robust, use tracing in production systems, either our own CTF tracing or your own or third party… it will save your life one day! Use runtime routines to catch error and log them (CBL_ERROR_PROC), ensure your programs shutdown cleanly always use CBL_EXIT_PROC.
- Use the generator directive nocheck if you are happy your code is solid and want to a little more performance. ie: it turns off runtime bounds checking
Yes.. its a bit of a mixed list.. but hey it may be of help!