Highlighted
Absent Member.
Absent Member.
836 views

Calling Managed COBOL from C#

Hello,

I also need to call COBOL programs from C# on MicroFocus environment.

I have checked the C# Winbook example and my solution based on it worked perfectly.

But I have a lot of already existing COBOL code, which is in form of "Managed Mainframe Subsytem Application" instead of "Class Library" Project with preference to compile into Multiple Assemblies, and I have encountered multiple problems with calling this COBOL code from C# in a way presented in example mentioned before.

1. Referencing a project is not helpful, because each COBOL file in project creates its own assembly.
I solved it with referencing directly DLLs created from COBOL sources.


2. ilsmartlinkage appears to not work in this type of COBOL project (despite enabling this option in project preferences). Thus, classes representing parameters defined in linkage sections are either not generated at all or not available in my C# project.
Any help in solving this issue would be appreciated.

Best Regards

0 Likes
2 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Calling Managed COBOL from C#

What product and version are you using? If you are using Managed Mainframe Subsystem Application templates then I assume you are using Enterprise Developer and not Visual COBOL is that correct?

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Calling Managed COBOL from C#

Why are you compiling the programs as Managed Mainframe Subsystem Applications? That project type is for applications running under Enterprise Server for .NET, using CICS or JCL emulation. Are these CICS or JCL batch programs?

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.