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

CALL
CALL’s behavior is determined by the PORT directive. If the program is not compiled with the PORT
directive, CALL transfers control from one COBOL program to another COBOL program. The called
program can be in the current compilation unit or can be extracted from an object file, provided
that the entry point called is in a code block created by a COBOL compiler on an HP system. To
transfer control from a COBOL program to a program written in another language in the absence
of the PORT directive, use ENTER (see ENTER).
If the program is compiled with the PORT directive, CALL behaves like the X/Open CALL statement
(which is not an element of COBOL). The X/Open CALL statement transfers control from an
HP COBOL program to a program written in another language.
NOTE: If you use the X/Open CALL statement in the OSS environment, see Mixed-Language
Programs (page 712).
If the called program is not a function, the X/Open CALL statement does not change the value of
RETURN-CODE.
If the value of the function is greater than 99,999, arithmetic overflow occurs.
If the called program is not a function, the called program cannot change the value of
RETURN-CODE.
If a called program changes the value of RETURN-CODE, the calling program can access that
value when control returns to the calling program.
If the program was not compiled with the PORT directive, RETURN-CODE is inaccessible.
called-entity
program-name
is the program-name in the called program’s PROGRAM-ID paragraph. It can be expressed
as a nonnumeric literal (enclosed in quotation marks) or the actual name (not enclosed in
quotation marks). The form enclosed in quotation marks is recommended.
If the program is not compiled with the PORT directive, the called program must be a
COBOL program.
CALL 293