Pathway/iTS SCREEN COBOL Reference Manual (G06.24+, H06.03+, Pathway/iTS 1.0+)
Procedure Division
Compaq NonStop™ Pathway/iTS SCREEN COBOL Reference Manual—426750-001
6-70
SEND Statement
TERMINATION-STATUS can be used to identify the actual reply code received as
described later in this section.
VARYING
can be used to control error logging when variable-length replies are expected.
When the ON ERROR clause is present, the keyword VARYING suppresses the
logging of error 3115 (TRANSACTION REPLY SIZE INVALID) when the reply is
shorter than the YIELDS buffer. Error 3115 is still logged whenever the reply
length exceeds the length of the YIELDS buffer. The keyword VARYING has no
effect unless the ON ERROR clause is present.
identifier-2
is a data name into which a portion of the contents of the reply message is to be
placed.
CODE OTHER
is used to ensure that a match on the reply code will always occur, thus preventing
the logging of error 3112 (REPLY NUMBER NOT KNOWN TO PROGRAM)
when the actual reply code is not found in the list of expected reply codes. Note that
the CODE OTHER clause can appear by itself when no explicit reply codes are
expected.
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 STMT 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.