Project Description
CLR via COBOL is a collection of object-oriented COBOL programs showing how to use .NET types, define structs and classes, inherit, implement interfaces, etc. The programs cover topics from COBOL standard ISO/IEC 1989:2002(E), Micro Focus Net Express Help, and the MSDN Library.

Project Status
The current set of 25 programs is comparable to Chapter 1 of the MCTS 70-536 Self-Paced Training Kit. They provide a quick tour of language and framework fundamentals. After having learned these concepts, you'll find the main task to be learning the details of framework types. In this respect, COBOL is no different than any other .NET language.

System Requirements
To build and run the sample programs will require a few additional developer toys, which (except for the operating system) are available at no charge:

  1. Windows Vista/XP/2000 (any version), Windows 7 Pro, or Windows 7 Ultimate: Note that in Windows 7, Net Express 5.1 Personal Edition can only be installed in Windows XP Mode (which unfortunately is not available for Windows 7 Home). In order to work together in Windows 7, all software listed below must be installed in Windows XP Mode. Performance is not great in Windows XP Mode, but it does work.
  2. NET framework 3.5: Self-explanatory.
  3. Visual Studio 2008 or Visual Studio Shell: This is a prerequisite, without which Net Express will not install. Express editions of Visual Studio do not meet this requirement, but if necessary you can install the free Visual Studio Shell as follows:
    1. Download the integrated mode version of the shell here.
    2. Run the "installer". Note that all this does is extract the redistributable package.
    3. Navigate to the new folder, C:\VS 2008 Shell Redist\Integrated Mode, and run vside.enu.exe. This will install the Visual Studio Shell, along with some runtime components for applications developed with Visual C++. Once you have either Visual Studio 2008 or the Visual Studio Shell installed, you can go ahead and install Net Express.
  4. Micro Focus Net Express 5.1 Personal Edition: This free software is your source for the required Micro Focus COBOL runtime DLLs. It will also enable you to create your own managed COBOL projects in Visual Studio, and native COBOL programs in Net Express. Bear in mind that the Personal Edition of this compiler and COBOL runtime are for personal use only.

Having met the requirements above, you may now download the COBOL.NET source code for this project, and tinker with it in Visual Studio 2008. Launch Visual Studio, create a new COBOL console project, remove the auto-generated Program1.cbl file, and add the COBOL via CLR source file of your choice to the project. Then you can either debug or build the project.

If running Windows 7, please note that you will have launch Visual Studio 2008 in Windows XP Mode.

I will at some point try to provide a more convenient means of testing the sample code, but this will work for now. For simplicity's sake, each sample program has its own Main program, which means they can't all reside in the same project. Compiling single files at the command line, as is commonly done with simple Mono C# examples, seems most elegant. However, I haven't yet figured out the required command line parameters for compiling COBOL.NET with the Micro Focus compiler.


Loosely speaking, this collection of programs will follow the outline of the MCTS 70-536 Self-Paced Training Kit. COBOL does support WPF and WCF, but for maximum foundational value the initial focus here will be on console applications and DLLs.

Last edited Jan 1, 2012 at 4:48 AM by mfisher_ix, version 38