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

Process Initiation, Communication, and
Management
HP COBOL Manual for TNS/E Programs520347-003
31-13
RECEIVE-CONTROL Paragraph
RECEIVE-CONTROL Paragraph
The RECEIVE-CONTROL paragraph of the Environment Division is an HP extension
to COBOL. The RECEIVE-CONTROL paragraph in process $XX serves these
purposes:
It defines the receive-control table for process $XX. This specifies the maximum
number of other processes that can have process $XX open concurrently. When all
such other processes close process $XX, an HP COBOL run-time routine reports
an end of file (EOF) on $RECEIVE.
It defines the reply table for process $XX. This specifies the number of replies (and
the length of a reply) to be saved for each requesting process. A process with a
fault-tolerant requester must allow for replies to be saved so that the fault-tolerant
facility can retransmit them to restore synchronization in the case of a takeover by
the requester’s backup process. (If the requester is not fault-tolerant, the reply
table is useless and wastes space.)
It designates a data item to contain an error code to be returned to a requesting
process that is handling process $XX as a device. Every device in the system
returns an error code, a condition code, and a reply-message text.
DATA DIVISION.
FILE SECTION.
FD PRINT-LINES-IN
LABEL RECORDS ARE OMITTED.
01 LINE-IN PICTURE X(80).
WORKING-STORAGE SECTION.
01 PRINT-STATUS PICTURE X(2).
88 SENDER-DISAPPEARED VALUE "10".
PROCEDURE DIVISION.
A.
OPEN INPUT PRINT-LINES-IN.
PERFORM TRANSPUT THROUGH END-TRANS
UNTIL SENDER-DISAPPEARED.
STOP RUN.
TRANSPUT.
READ PRINT-LINES-IN
AT END GO TO END-TRANS.
DISPLAY LINE-IN.
END-TRANS.
EXIT.
Example 31-7. CATCHER Code (page 2 of 2)