COBOL Manual for TNS and TNS/R Programs
HP COBOL CRE Support
HP COBOL Manual for TNS and TNS/R Programsā522555-006
18-2
Introducing the CRE
Introducing the CRE
On C-series systems, the HP C, HP C++, HP COBOL, FORTRAN, Pascal, and TAL
programming languages each have their own unique run-time environments defined by
their respective run-time libraries. These language-specific run-time environments are
often incompatible with each other because each languageās run-time library is
unaware of other run-time libraries. This incompatibility severely limits the potential for
creating useful mixed-language programs.
On D-series systems, the Common Run-Time Environment (CRE) is a set of services
that supports mixed-language programs. The CRE library is a collection of routines that
implements the CRE. The CRE library enables the language-specific run-time libraries
to coexist peacefully with each other. User routines and run-time libraries call CRE
library routines to access shared resources managed by the CRE, such as the
standard files (input, output, and log) and the user heap, regardless of language.
The CRE does not support all possible operations. For example, the CRE supports file
sharing only for the three standard files: standard input, standard output, and standard
log. The language-specific run-time libraries access all other files by calling operating
environment procedures directly, whether or not a program uses the CRE.
If one program in a run unit runs in the CRE, every program in that run unit must run in
the CRE.
If a program runs in the CRE, each routine in the program appears to be running in its
own language-specific run-time environment, regardless of the language of the main
routine. For example, if the main routine of a mixed-language program is written in
HP COBOL, an HP C routine has complete access to the HP C run-time library.
If a program does not use the CRE, routines written in languages other than that of the
main routine have limited access to their run-time libraries. For example, if the main
routine of a mixed-language program is written in HP COBOL, an HP C routine has
limited access to the HP C run-time library.
Table 18-1. Run-Time Environments
Language TNS Programs Native Programs
HP C CRE CRE
HP C++ CRE CRE
HP COBOL CRE or
COBOL environment
CRE
FORTRAN CRE or
FORTRAN environment
Not applicable
Pascal CRE Not applicable
pTAL CRE CRE
TAL CRE or
TAL environment
Not applicable