COBOL Manual for TNS/E Programs (H06.08+, J06.03+)

NOTE: If the process is running at a high PIN, the process ID that the operating
environment returns is synthetic. For information about synthetic IDs of high-PIN processes,
see the Guardian Application Conversion Guide.
It specifies which classes of operating environment messages are to be passed to process
$XX.
An ordinary Pathway server uses only three entries of the RECEIVE-CONTROL paragraph:
TABLE OCCURS
Specifies how many requesters can have the server open at one time. Any additional requesters
attempting to open the server are refused. This value must be greater than or equal to the
MAXLINKS value in the PATHCOM command file that created the PATHMON environment.
A large value is recommended.
SYNCDEPTH
Usually set to 1 for Pathway servers unless they are multithreaded.
REPLY CONTAINS
Specifies the length of the reply that the server sends back to the requester. It specifies the
name of the file containing the longest record that is used as a reply or an explicit number of
characters.
At-End Condition
An entry is made in the receive-control table when a requester executes an OPEN for a file assigned
to the server process. A requester can have more than one OPEN issued to a server process at
any given time. The receive-control table has a separate entry for each of these OPENs.
An entry is deleted from the receive-control table whenever the requester issues a CLOSE for the
file assigned to the server process. A server continues to receive requester messages through
$RECEIVE if there is an entry in the table. When the last entry is deleted, an at-end condition arises
for the server’s READ statement.
This at-end condition is handled as an end of file for $RECEIVE. If a file status code data item is
defined, it is set to “10” (EOF). Control passes to the statement in the AT END phrase or to a USE
procedure if no AT END phrase is present. If the server is a Pathway server, it must stop itself when
it detects an at-end condition.
An attempt to read a file when it is at end of file causes a permanent error, setting the file status
code to “30.” Ordinarily, the program must close and reopen the file before any further activity
is possible on that file. For $RECEIVE, however, the run-time routines simulate a close/open
sequence, relieving the program of this responsibility; however, such a READ after end of file
should include a TIME LIMIT phrase, or the READ could wait indefinitely. See READ for Sequential
or Dynamic Access (page 405).
When a server process has just begun execution and no entries are yet in its receive-control table,
an at-end condition will never occur before the first OPEN message is received.
Summary of $RECEIVE Rules
These rules apply to programs that use $RECEIVE:
Files assigned to $RECEIVE must be sequentially organized and not described with alternate
keys or LINAGE clauses.
A RECEIVE-CONTROL paragraph in the Input-Output Section of the Environment Division is
necessary to define two internal tables essential to the function of $RECEIVE. (Although the
RECEIVE-CONTROL paragraph is optional, the default tables permit only the most limited use
of $RECEIVE.)
924 Process Initiation, Communication, and Management