CRE Programmer's Guide
CRE Services
Common Run-Time Environment (CRE) Programmer’s Guide—528146-004
2-8
Writing pTAL Routines That Use the Native CRE
behavior if a math function detects an error. For more details, see Traps and 
Exceptions on page 2-3.
For more information on using TAL in mixed-language programs and writing TAL 
programs that use TNS CRE services, see the TAL Programmer’s Guide.
Writing pTAL Routines That Use the Native 
CRE
This subsection describes considerations for pTAL language routines that run in the 
CRE. Unlike C and C++ routines, pTAL routines must call native CRE functions 
explicitly to access native CRE services because pTAL does not support standard 
input, standard output, and standard error file I/O, math, or string functions.
pTAL cannot be used to create the main routine of a program that runs in the CRE.
A C or native-mode COBOL main routine that calls a pTAL routine can be used to 
provide almost the same functionality.
A program with a pTAL main routine cannot link to a native user library that runs in the 
CRE. Thus, the native user library for such a program cannot be written in C, C++, or 
native-mode COBOL.
A program with a C or native-mode COBOL main routine can link to a native user 
library that runs in the CRE or follows the guidelines for CRE compliance. Thus, the 
native user library for such a program can be written in C, native-mode COBOL, or in 
pTAL that complies with the following guidelines:
•
Do not directly manipulate program resources that are likely to be shared with 
other languages.
•
Call CRE_Terminator_, not the PROCESS_STOP_, STOP or ABEND system 
procedures, for pTAL routines that terminate program execution.
•
Call system procedures to access resources that are not managed by the CRE.
•
Call system procedures to access resources that can be managed by the CRE, but 
that you do not want to share with routines written in other languages.
•
Call the native CRE functions described in Section 6, CRE Service Functions, to 
access resources managed by the native CRE that you want to share with routines 
written in other languages. 
•
Source in the files CRERDECS, RTLRDECS, or CLURDECS where applicable.
•
Do not use the INITIALIZER system procedure. Both the CRE and the 
INITIALIZER procedure read system messages, including the startup message, 
the PARAMs message, and ASSIGN messages.
Programs that use sequential I/O (SIO) procedures (for example, OPEN^FILE, 
READ^FILE, WRITE^FILE, CLOSE^FILE, and so forth) are particularly likely to use 
the INITIALIZER system procedure.










