Pathway/iTS SCREEN COBOL Reference Manual (H06.10+, J06.03+)
Procedure Division
HP NonStop Pathway/iTS SCREEN COBOL Reference Manual—426750-003
6-98
SEND Statement
The CODE OTHER clause must be the last CODE clause in the SEND verb; if it is
followed by a CODE <value> clause, SCREEN COBOL will report error 616
('CODE OTHER' must be last statement in reply code list of SEND).
Reply code values must not appear in the same CODE clause as the keyword
OTHER. The sequence CODE 1 2 OTHER will produce error 44 (SYNTAX
ERROR DETECTED AT TOKEN) and error 48 (PARSING RESUMED AT
TOKEN); the sequence CODE OTHER 1 2 will produce the same error.
ON ERROR
provides a point of control if an error occurs in sending the message.
If this clause is omitted and an error is detected, standard system action is
performed. Depending on the error, system action involves either waiting for a
resource to become available or suspending execution of the program.
Errors that occur during execution of a SEND statement can be looked up by
number 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.
At the end of this section is a list of the error numbers found in the TERMINATION-
STATUS special register.
imperative-statement
is the statement to be executed if an error is detected.
Use of Reply Codes and Termination Status
A message containing a variable-length data item cannot be easily decomposed by a
server written in COBOL; the only exception is when the variable-length data item is
the last item of the message.
If a server is to process more than one type of message, a data item of the message
should contain a field that identifies the type of transaction unless the content of the
data itself determines the transaction type.
Specifying
reply-code-value
after the CODE keyword identifies the structure of the
reply. When the send operation receives the reply from the server, the first two bytes
are interpreted as a 16-bit integer. This 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
reply-code-value
. The special register TERMINATION-STATUS
is set to a number corresponding to the position of the particular reply code value in the
list, providing the TCP did not find an error while executing the 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.










