Overview

Existing COBOL can be recompiled to .NET managed COBOL, so that it can invoke and be invoked by managed code in other .NET languages, such as C#. However, the COBOL must use data types that are compatible with those languages. There is not a strict one-to-one correspondence with types in every language, and so you might need to manipulate the COBOL data into compatible types.

For example, a C# program might invoke COBOL and want to pass an object pointer, where the object has properties containing the data to be passed. The called COBOL method has to extract the data required from the object properties and convert it into COBOL types, such as a group item containing PIC X fields. The original COBOL can then handle the data in its traditional form.

Essentially, you need to expose the Linkage Section items as data types that the non-COBOL code can understand. There are many ways to do this, but some options are to use: