Pathway/iTS SCREEN COBOL Reference Manual (G06.24+, H06.03+, Pathway/iTS 1.0+)

Procedure Division
Compaq NonStop™ Pathway/iTS SCREEN COBOL Reference Manual426750-001
6-86
SEND MESSAGE Statement
3. If the SEND MESSAGE statement detects an error, it sets TERMINATION-
STATUS to a value indicating the type of error and performs the procedure
DEVICE-DUMB.
The reply code values could also be numeric. Consider the following example:
SEND MESSAGE INQUIRY
REPLY CODE FIELD IS REPLY-CODE-FIELD OF MESSAGE-REPLY-OK
CODE 1, 21, 31 YIELDS MESSAGE-REPLY-OK
CODE 2, 42, 62 YIELDS MESSAGE-REPLY-NOGOOD
ON ERROR PERFORM DEVICE-DUMB.
In the example, the special register TERMINATION-STATUS is set as follows:
REPLY CODE TERMINATION-STATUS
1 1
21 2
31 3
2 4
42 5
62 6
Consider the following SCREEN COBOL example of processing the ESCAPE
ON UNSOLICITED MESSAGE clause:
CONTINUE-ACTION.
SEND MESSAGE REQUEST-MESSAGE
REPLY CODE "AA" YIELDS reply-aa
CODE "XX" YIELDS reply-xx
ESCAPE ON UNSOLICITED MESSAGE
TIMEOUT FIVE-MINUTES
ON ERROR
PERFORM ERROR-ANALYSIS.
* Normal reply processing:
PERFORM ONE OF AA-RPLY-ACTION
XX-RPLY-ACTION
UNSOL-MSG-ARRIVED
DEPENDING ON TERMINATION-STATUS.
UNSOL-MSG-ARRIVED.
PERFORM SAVE-OUTCOME.
RECEIVE UNSOLICITED
YIELDS UNSOL-STATS-REQST.
. . .
REPLY TO UNSOLICITED latest-stats
* Save the outcome of the SEND MESSAGE I/O.
SAVE-OUTCOME.
IF TERMINATION-SUBSTATUS = 187
MOVE OP-QUIESCENT TO OP-OUTCOME
ELSE
IF TERMINATION-SUBSTATUS = 188