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-34
Passing Parameters to Non-COBOL Routines
The code for reference modification is:
01 A-FILENAME PIC X(20)
...
MOVE 0 TO A-COUNT
INSPECT FUNCTION REVERSE (A-FILENAME) TALLYING A-COUNT
FOR LEADING SPACES
ENTER "FILE_GETINFOBYNAME_"
USING A-FILENAME
(1: FUNCTION LENGTH (A-FILENAME) - A-COUNT) ...
The code for using an OCCURS clause is:
01 A-FILENAME.
02 PIC X OCCURS 1 TO 20 TIMES DEPENDING ON
A-FILENAME-LENGTH.
01 A-FILENAME-LENGTH PIC 99 COMP.
Set A-FILENAME-LENGTH to the right length and call FILE_GETINFOBYNAME_
without using reference modification.
For more information about TAL procedures, see the TAL Programmer’s Guide. For
more information about pTAL procedures, see the pTAL Reference Manual.
Example 23-10. Passing Parameters to a TAL Routine
HP COBOL code:
DATA DIVISION.
WORKING-STORAGE SECTION.
01 ONE-WORD USAGE NATIVE-2.
01 TWO-WORD USAGE NATIVE-4.
01 FOUR-WORD USAGE NATIVE-8.
01 A-STRING PICTURE X(25).
...
PROCEDURE DIVISION.
...
ENTER TAL "proc1" USING ONE-WORD
TWO-WORD
FOUR-WORD
A-STRING
TAL routine:
PROC proc1 (a, b, c, d);
INT a;
INT(32) b;
FIXED(0) c;
STRING .d; -- pointer to array
BEGIN
...
END;