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

Environment Division
HP COBOL Manual for TNS/E Programs520347-003
6-59
RECEIVE-CONTROL Paragraph
The $RECEIVE mechanism of a server written in HP COBOL uses the receive-control
table (sometimes called the Requester table) to record the status of the requesting
processes that have opened the server. It uses the reply table to keep copies of the
replies it has sent to each requesting process.
When the requester is running as a process pair and the requester sends a message
and the backup process takes over before the requester receives a reply, the server
can resend the reply automatically if a CHECKPOINT statement is executed after the
server reads the requester’s message and before the server writes a reply (or
generates one automatically with another READ). In this case, the server does not see
the duplicate message. The CHECKPOINT statement can be executed even if the
server is not running as a process pair.
In the simplest case, when a single requester and a single server are involved and
neither is running as a process pair, the default tables can accommodate the
$RECEIVE operations.
The ERROR clause provides a means of specifying that the server itself (and not its
run-time routines) takes responsibility for specifying any error number that the
$RECEIVE mechanism is to deliver to the requester. The MESSAGE SOURCE phrase
provides a means of identifying the sender of any message arriving through
$RECEIVE. The REPORT clause provides a means of specifying the classes of
messages arriving at $RECEIVE that are to be delivered to the server, rather than
handled automatically by the $RECEIVE mechanism.
National literals and national data items cannot be used in a RECEIVE-CONTROL
paragraph.
The RECEIVE-CONTROL paragraph for a run unit is the one in the first program to
open $RECEIVE.