Pathway/iTS SCREEN COBOL Reference Manual (H06.10+, J06.03+)

Procedure Division
HP NonStop Pathway/iTS SCREEN COBOL Reference Manual426750-003
6-53
DIALOG-SEND
Errors that occur during execution of a DIALOG-SEND statement can be referred
to on number basis in the TERMINATION-STATUS special register to determine
the meaning and recommended action. For some errors, additional information is
reported in the TERMINATION- SUBSTATUS special register.
imperative-statement
is the statement to be run if an error is detected.
Use of Reply Codes and Termination Status
Specifying
reply-code-value
after the CODE keyword identifies the structure of the
reply. When the DIALOG-SEND operation receives the reply from the server, the first
two bytes are interpreted as 16-bit integer. The code must match one of the CODE
reply code values. The entire reply is then distributed to the items in the identifier -2 list
associated with the
reply-code-value
. The special register
TERMINATIONSTATUS is set to a number corresponding to the position of the
particular reply code value in the list. Entering the TCP did not locate an error while
executing the DIALOG-SEND statement. Each
reply-code-value
corresponds to a
unique number setting for TERMINATION-STATUS whether or not a reply code value
yields the same Working-Storage data item. If there is no match or if the reply
message data does not exactly fill the data items in the
identifier-2
list, an error is
indicated. In the DIALOG-SEND statement, the position of a reply code affects the
value set for the TERMINATION-STATUS special register as illustrated in this
example:
DIALOG-SEND HEADER, LASTNAME OF EMP-REC
REPLY CODE 1, 21, 31 YIELDS R-CODE, NEW-SALARY
CODE 2, 42, 62 YIELDS NEW-RATE, STOCK-OPTION, BENEFIT CODE 0,
200 YIELDS TERMINATION-NOTICE
ON ERROR PERFORM SERVER-LIST.
In this example, the positions of the reply codes cause these corresponding values to
be set for TERMINATION-STATUS:
Reply Code Termination Status
1 1
21 2
31 3
2 4
42 5
62 6
0 7
200 8