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-21
What HP COBOL Can Pass by Content
What HP COBOL Can Pass by Content
An HP COBOL program can pass these types of items to non-COBOL routines by
content:
•
Elementary Data Items
•
Tables
•
Numeric Literals
•
Values of Arithmetic Expressions
•
HP COBOL File Names
Elementary Data Items
The most practical categories and sizes for elementary data item parameters to be
passed by content are:
The names of elementary data item parameters can be qualified, subscripted, or both,
but cannot include reference modifiers.
Passing a COMPUTATIONAL numeric data item as a parameter is not recommended.
Although a data item described as
PICTURE S9(4) USAGE COMPUTATIONAL
is allocated 2 bytes, the value that can be stored in them must be in the
COMPUTATIONAL range -9999 through 9999. Anything outside that range is truncated
on the left by the MOVE operation.
The compiler generates any code necessary to convert numeric actual parameters to
the form required by the external routine, including scaling and conversion to the
required storage size and data type. Similarly, the compiler generates any code that is
necessary to convert the numeric value that an external routine returns to the form
required by the data item in the GIVING phrase of the HP COBOL program’s ENTER
statement.
The other CRE languages handle nonnumeric data items as strings.
Parameter Category and Size USAGE
Numeric 2-byte NATIVE-2
Numeric 4-byte NATIVE-4
Numeric 8-byte NATIVE-8
Alphanumeric PICTURE X(n )