CRE Programmer's Guide
CRE Services
Common Run-Time Environment (CRE) Programmer’s Guide—528146-004
2-35
$RECEIVE and Program Initialization
PARAM messages; the CRE, therefore, does not process such messages when it runs
in the OSS environment.
$RECEIVE and Program Initialization
During program initialization, the CRE reads initialization messages from $RECEIVE.
At the end of program initialization, the CRE closes $RECEIVE. $RECEIVE remains
closed until the CRE receives a request to open it or the CRE itself needs to open it.
Messages Received From $RECEIVE
Your program can receive the following kinds of messages from $RECEIVE:
•
System messages that alert your program to important system state changes (for
example, “CPU down” messages, process ABEND messages, and so forth).
•
System messages sent by the operating system because a process has called a
system procedure that addresses your process (for example, calls to
FILE_OPEN_, SETMODE, CONTROL, and so forth).
•
Messages sent to your process by other processes.
$RECEIVE and the Languages Supported by the CRE
You can read $RECEIVE from any language supported by the CRE. There are two
ways to access $RECEIVE, by calling either CRE functions only or system procedures
only.
TNS CRE
A program can use TNS CRE functions to access $RECEIVE.
Native CRE
A program that runs in the native CRE can use native CRE functions to access
$RECEIVE.
Using CRE Functions to Access $RECEIVE
When a COBOL or FORTRAN routine opens $RECEIVE, the language-specific run-
time library calls the CRE functions that manage $RECEIVE. C or C++, and TAL or
pTAL routines can participate in this model by calling the CRE functions that manage
$RECEIVE. The CRE grants a connection for each open, but all connections share the
same file attributes and the same operating system file open. Functions that manage
$RECEIVE are described in Section 6, CRE Service Functions
.
The CRE opens $RECEIVE for exclusive access. If the CRE opens $RECEIVE, no
other routine in your program can open it. If a routine in your program opens
$RECEIVE by a direct call to FILE_OPEN_, or if a C run-time library opens