Highlighted
Absent Member.
Absent Member.
1043 views

Mapping COBOL Records in C#

Jump to solution

Hi, I'm trying to call a procedural COBOL program that is using a COBOL record, in C# the record is represented as String so how can I manipulate the record and be able to fill it and extract it as well. The procedural program is managed -not native-.

 

Regards

0 Likes
1 Solution

Accepted Solutions
Highlighted
Micro Focus Expert
Micro Focus Expert

In the runtime services they is a type called MarshallUtils that allows you to marshall a struct to a byte[] and back, alternatively use the ILSMARTLINKAGE directive and this will generate extra types for any linkage section items...both are documented.

View solution in original post

0 Likes
2 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

In the runtime services they is a type called MarshallUtils that allows you to marshall a struct to a byte[] and back, alternatively use the ILSMARTLINKAGE directive and this will generate extra types for any linkage section items...both are documented.

View solution in original post

0 Likes
Highlighted
Absent Member.
Absent Member.

Thank you very much spgennard. I am gandalfing through the docs and it's amazing especially this part

"Compiling with ILSMARTLINKAGE exposes the group item in the program as a new class, and the group items as properties of that class. Other managed languages do not recognize hyphenated data items but ILSMARTLINKAGE caters for that as well - it removes the hyphens from the names of the data items and changes the case to camel case. As a result, other managed languages will seeoperandsexposed as the classOperands, and the variablesop-1andop-2exposed as the propertiesOp1andOp2of that class. Similarly,func-codeis exposed asFuncCode."

OMG! I feel like I'm in heaven! Micro Focus deserves the Turing Award for Visual COBOL and such a wonderful documentation.

Best Regards

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.