COBOL Manual for TNS/E Programs (H06.08+, J06.03+)

01 FLIP USAGE IS NATIVE-2 EXTERNAL.
01 FLAP USAGE IS NATIVE-4 EXTERNAL.
01 FLOP USAGE IS NATIVE-8 EXTERNAL.
C code:
extern short FLIP;
extern long FLAP;
extern long long FLOP;
FLOP = (long long)((long)FLIP * FLAP);
Example 256 Passing a String to a C Routine
HP COBOL code:
DATA DIVISION.
WORKING-STORAGE SECTION.
01 A-STRING PICTURE X(25).
...
PROCEDURE DIVISION.
...
ENTER C "FUNCT1" USING A-STRING
C routine:
FUNCT1 (char *d)
...
return void;
pTAL
If a pTAL parameter is to be passed by value, an HP COBOL program can pass a numeric
literal, a numeric data item, or the value of an arithmetic expression. The compiler generates
code that evaluates, scales, and converts the value to the form that the called pTAL procedure
expects.
If a pTAL parameter is to be passed by reference, an HP COBOL program can pass an FD
file name (to pass the address of the file control block) or a data item (to pass the address of
the data item).
An HP COBOL program that calls a pTAL procedure can omit any optional parameters,
substituting the keyword OMITTED for each omitted optional parameter.
In pTAL, if you declare a routine to be EXTENSIBLE or VARIABLE, its formal parameters are
optional (meaning that the calling program need not supply the actual parameters). If an HP
COBOL program calls an extensible or variable pTAL routine, the HP COBOL program must
use the keyword OMITTED in place of each omitted optional parameter, except in the case
of trailing omitted optional parameters. For example, if the pTAL procedure declaration is:
PROC my_proc (a, b, c) VARIABLE;
INT .EXT a;
INT .EXT b;
INT .EXT c;
BEGIN
...
END;
Then an HP COBOL program can call the pTAL routine with any of these statements:
ENTER TAL "MY_PROC" USING A
ENTER TAL "MY_PROC" USING A B
ENTER TAL "MY_PROC" USING A B C
ENTER TAL "MY_PROC" USING A OMITTED C
pTAL has a parameter type called string:length that is defined:
810 Calling Other Programs and Routines