Skip to main content

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

  • January 17, 2011
  • 3 replies
  • 0 views

[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.

3 replies

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

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

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