COBOL Manual for TNS and TNS/R Programs
Calling Other Programs and Routines
HP COBOL Manual for TNS and TNS/R Programs—522555-006
23-22
What HP COBOL Can Pass by Content
Tables
To pass a table (an array) by content, you must create a data structure that consists
solely of the array elements and pass the name of that data structure. The
corresponding formal parameter must be defined to use a content parameter. For
example, to pass the table of Cs in Example 23-3, you must pass the name C-ARRAY.
HP COBOL handles any data structure as a stream of characters, so the compiler
does not perform numeric conversions on table elements. If you have a table of
elements whose descriptions do not match those of their corresponding formal
parameters, you must create a new table whose element descriptions match exactly,
copy the values form the original table to the new table, and pass the name of the new
table as the actual parameter.
Numeric Literals
HP COBOL can pass numeric literals, but not nonnumeric literals, as content
parameters. The compiler generates any code that is necessary to convert them to the
form required by the external routine.
Values of Arithmetic Expressions
TNS HP COBOL can pass the value of an arithmetic expression to HP C, Pascal, and
TAL (but not FORTRAN) routines by content. Native HP COBOL can pass the value of
an arithmetic expression to native HP C, native HP C++, and pTAL routines by content.
The compiler generates any code that is necessary to convert the value of an
arithmetic expression to the form required by the external routine.
HP COBOL File Names
HP COBOL can pass COBOL file names to COBOLLIB and ZCOBSRL routines that
accept them. The COBOL file name is the file name recognized by the HP COBOL
program’s input-output statements, not the file name recognized by the operating
environment. The data structures that enable the COBOLLIB and ZCOBSRL routines
to accept COBOL file names are proprietary to HP and are not available to users.
Example 23-3. Record Containing a Table
01 A-RECORD.
03 A PIC S999V99.
03 B PIC S999V99.
03 C-ARRAY.
05 C OCCURS 7 TIMES USAGE NATIVE-2.
03 D PIC X(15).