COBOL Manual for TNS and TNS/R Programs

HP COBOL Manual for TNS and TNS/R Programs522555-006
23-1
23
Calling Other Programs and
Routines
Your TNS HP COBOL program can call other TNS programs and routines, and your
native HP COBOL program can call other native programs and routines. TNS and
native programs cannot call each other.
A HP COBOL program that calls one or more non-COBOL routines is called a mixed-
language program (as is a non-COBOL program that calls one or more COBOL
programs). Mixed-language programs are less restricted and execute more efficiently
in the CRE.
The CRE is available in the Guardian environment and the OSS environment.
A HP COBOL programs mode and operating environment determine what types of
non-COBOL routines it can call, as Table 23-1 shows.
A called routine can have an ordinary, VARIABLE, or EXTENSIBLE parameter list.
Topics:
Run-Time Environment
Calling Other COBOL Programs
Calling Non-COBOL Routines
Passing Parameters
To call your HP COBOL program from a non-COBOL program, use the non-COBOL
language’s method of calling an external routine. The method varies from language to
language; see the reference manual for the appropriate non-COBOL language.
Note. This section applies to the Guardian environment. For information on mixed-language
programming in the OSS environment, see Mixed-Language Programs and Utility Routines.
Table 23-1. Effect of Mode and Environment on Calling Non-COBOL Programs
Mode Environment HP COBOL program can call programs written in ...
TNS Guardian TNS HP C, TNS HP C++, FORTRAN, Pascal, TAL
OSS TNS HP C, TNS HP C++, TAL
Native Guardian or
OSS
Native HP C, native HP C++, pTAL