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-7
Calling Non-COBOL Routines
If you want an HP COBOL program to be entirely free to call any other COBOL
program that is prepared to be called, make the programs separate processes.
Separate processes communicate through the file process $RECEIVE—the sender
writes to a named process, and the receiver reads a file named $RECEIVE. For more
information about $RECEIVE, see $RECEIVE.
Calling Non-COBOL Routines
The way an HP COBOL program can call a non-COBOL routine depends on its
environment and whether the calling program was compiled with the PORT directive.
An HP COBOL program that was not compiled with the PORT directive calls a non-
COBOL routine with the ENTER statement. An HP COBOL program that was compiled
with the PORT directive and runs in the CRE calls a non-COBOL routine with either the
ENTER statement or the CALL statement, which behaves like an X/Open CALL
statement.
Topics:
•
ENTER Statement
•
X/Open CALL Statement
•
Functions (Routines That Return Values)
•
Operating System Routines
•
HP COBOL Run-Time Routines
•
COBOL Utility Routines
•
ENFORM Programs
•
Restrictions on Calling Non-COBOL Routines
ENTER Statement
Topics:
•
TNS Programs
•
Native Programs
Note. If the types of the actual and formal parameters do not match, the ENTER statement
attempts to convert the actual parameters to the types of the formal parameters; the X/Open
CALL statement reports an error instead.
Applying a CANCEL statement to a non-COBOL routine that was called with an X/Open CALL
statement terminates the run unit.