USENET/GOOGLE groups: comp.lang.cobol
skip to the main content area of this page
The Freeware COBOL data structure analysis tool (part 2 of 2)

While this page is primarily about the structure analysis tool, the process by which the tool was developed fits neatly as a demonstration of our recommended process model for migrating standard COBOL into .NET.

The steps to the process are generally as follows:

Migrating standard COBOL to the .NET Framework
  • Think about WHY you want to isolate certain functionality and make it available on .NET
    (Highly visible and/or volatile process support, efficiency of re-use, multi-core processing, part of a Service Oriented Architecture, etc.)
  • Isolate the standard COBOL code.
    This may mean adding headers if the code has been derived from a PERFORMed section or paragraphs, so it can compile as a main module (stand-alone). In our example, Robert's code was already a runnable nested COBOL program.
  • Re-Wrap the isolated COBOL code to become a COM component.
    This means adding headers that convert the standard COBOL to OO, and implement the COM interface. (Depending on the environment you are working in, this could be anything from a few to a couple of dozen lines.) It will probably involve adjustments to LINKAGE and/or WORKING-STORAGE sections, extracting nested COBOL programs (as shown in our example) or SECTION/PARAGRAPHs, to become METHODS in the new OBJECT. The whole output will be a runnable .DLL (Dynamic Link Library) that is "registerable" as a COM component.
  • Open a C# project.
    This is a FREE compiler and can be downloaded, along with the FREE (Express) version of Visual Studio, from:
    http://www.microsoft.com/Express/Download/
    You need to set a reference in the C# project, to your new COM component. (See the demo under point 3, below)
  • Add a User Interface into the C# code.
    This can be as fundamental as a single form with a couple of input boxes on it and a text area for output, right up to something much more sophisticated. The purpose is to collect what your component needs and provide a delivery mechanism for what it generates, back to the User. Within this code there will be a point where you have everything needed for input, and can activate your component. (See the demo under point 4, below)
$$More details and background for moving Legacy (Standard) COBOL to .NET...

How the tool was made...

engine

Robert's original COBOL code (the engine) .

This is standard non OO COBOL and includes a very useful parser for COBOL, as well as demonstrating how nested programs can be used in COBOL.

engine

Pete's wrapping of Robert's code (the engine becomes a COM component)

This is OO COBOL and implements the COM interface. Robert's nested programs have become Object Methods.

engine

Bringing it all together on .NET

We have to get InterOP services to manage the component in the .NET framework. The component is NOT CLR code, and was NOT written with a compiler that generates CLR. It still runs transparently in the Framework.

engine

Start 'er up!!!

Snippet of the C# code showing the COBOL Engine being activated

C# sample

Sample of the User Interface C# code.

This is the code for "form1" of the user interface. The full Visual Studio Solution, with all other code files, support files, images, and icons, is included with the COBOL Structure Analyser Tool Source download. (See button below).
Process diagram

Process diagram - Legacy COBOL to .NET

Sometimes a picture can be helpful...

This diagram shows an overall technical strategy for bringing COBOL Legacy into .NET.

If you are interested in tools to help you do this, or automate it, please contact: Pete Dashwood.(remove "xyz" from the mail link)

This process normally starts with converting ISAM flat files to Relational Database. PRIMA has tools that can fully automate this.

For further discussion of the process outlined here, click here

The COBOL structure analysis tool is Freeware (NOT Public Domain) software, and there are some minimal conditions attached to using it. The engine was written by Robert Wagner and the conversion to OO COM and plugging it into the .NET Framework was done by Pete Dashwood.
Please review our no-nonsens, plain English Licence terms. Once you have done so you will be able to download full source and/or the executable.

(You cannot download until you have viewed the Licence)