Highlighted
Absent Member.
Absent Member.
502 views

[archive] Passing COBOL file number or FD to C/C++

[Migrated content. Thread originally posted on 14 January 2011]

A bazaar question.
Using ACUCOBOL-GT v8.0.0. (with SP2 from Flexus) on HP-UX B.11.31 U ia64.

Within any programming language, when a file is opened (Open Output Printer), the operating system library (API) returns a "file Number" to the application run-time. I think (not sure) the AcuCobol run-time puts this number in the FD of the file section. This FD can be used only by the Cobol I/O verbs, WRITE, READ, and so on.

In any-case, where ever AcuCobol puts this file number, does anyone know of a Cobol method to get this file number into an integer in Cobol working storage?

I need to pass this file number to a C library where some addition I/O is done outside the Cobol Application.

Thanks in Advance,
Mike.
0 Likes
1 Reply
Highlighted
Absent Member.
Absent Member.

RE: [archive] Passing COBOL file number or FD to C/C++

Depending on what you try to achieve, the I$IO library routine may be the answer. Check it out in the documentation.
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.