COBOL Manual for TNS and TNS/R Programs
Process Initiation, Communication, and
Management
HP COBOL Manual for TNS and TNS/R Programs—522555-006
31-10
$RECEIVE
$RECEIVE as Input-Output File
In this case, $RECEIVE is opened in I-O mode to receive requests and reply to them
through the same file. Each request is acted upon and paired with a reply message
sent back in response to the task.
The requesting process follows the outline in Example 31-4.
Figure 31-3. $RECEIVE as Input/Output File
Example 31-4. Requester Code (page 1 of 2)
...
SELECT TRANSACTIONS ASSIGN TO "$BAL"
ORGANIZATION IS SEQUENTIAL
ACCESS MODE IS SEQUENTIAL.
...
FD TRANSACTIONS
LABEL RECORDS ARE OMITTED
RECORD CONTAINS 1 TO 8 CHARACTERS.
01 TRAN-RESPONSE.
05 RESULT-CODE PICTURE 9.
88 RESULT-OK VALUE IS 1.
88 RESULT-ERROR VALUE IS 2.
...
05 NEW-BALANCE PICTURE 9(7).
...
WORKING-STORAGE SECTION.
...
01 TRAN-REQUEST.
05 TRAN-CODE PICTURE 9.
88 TRAN-PMT VALUE IS 1.
...
05 ACCOUNT-NUMBER PICTURE 9(6).
...
Requester Server
Task Message
Reply Message
VST711.vsd