CRE Programmer's Guide
CRE Services
Common Run-Time Environment (CRE) Programmer’s Guide—528146-004
2-10
TNS CRE Initialization
a main routine. The following table shows an example of the syntax of a main routine, 
called MYMAIN, in each of the languages supported by the CRE.
The reference manual for each language describes the syntax of a main routine.
TNS CRE Initialization
During program initialization, the TNS CRE:
•
Opens $RECEIVE, processes the startup message, ASSIGN messages, and the 
PARAM message, and closes $RECEIVE.
°
For C main routines, the CRE saves the names and values of all PARAMs and 
ASSIGNs and returns them to your program automatically.
°
For COBOL and FORTRAN main routines, the CRE saves the names and 
values and returns them to your program if you specified the SAVE directive for 
the main routine.
°
For a TAL main routine, the CRE saves the names and values and returns 
them to your program if you specified the message-saving parameter in the 
TAL_CRE_INITIALIZER_ function.
The TACL Reference Manual describes how you specify ASSIGNs and PARAMs in 
TACL. The Guardian Programmer’s Guide describes how you process startup 
messages, ASSIGNs, and PARAMs.
The CRE processes ASSIGN messages following the same rules as the 
INITIALIZER system procedure. See the Guardian Procedure Calls Reference 
Manual for details.
Table 2-3 on page 2-11 shows the PARAMs that the CRE explicitly processes 
during initialization. The PARAM Values column shows the values that the CRE 
accepts for each PARAM. The CRE terminates your program if the value 
associated with any PARAM symbolic name is not valid. Termination occurs 
regardless of which languages are used to create program modules.
Language Examples of Main Routine Declarations
C
int main(); /* C main routine */
{ ... }; /* called "main" */
COBOL
?MAIN mymain
IDENTIFICATION DIVISION.
PROGRAM-ID. mymain.
FORTRAN
PROGRAM mymain
TAL
pTAL
PROC mymain MAIN;
BEGIN
 ...
END;










