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-75
SEND Statement
ERR-PARAGRAPH.
IF TERMINATION-STATUS = 11
MOVE length-mismatch TO err-flag
ELSE
MOVE genuine-err TO err-flag.
ADJUST-RP-LEN.
IF rp-cd = 15 PERFORM set-rp-1-len
ELSE IF rp-cd = 37 PERFORM set-rp-2-len.
SET-RP-1-LEN.
IF rp-len > max-rp-1-len
MOVE max-rp-1-len TO rp-len.
SET-RP-2-LEN.
IF rp-len > max-rp-2-len
MOVE max-rp-2-len TO rp-len.
GOOD-REPLY-PARAGRAPH.
IF rp-cd = 15
PERFORM rp-1-paragraph
ELSE IF rp-cd = 37
PERFORM rp-2-paragraph
ELSE
PERFORM logic-err-paragraph.
The example is executed as follows, assuming that the REPLY CODE is either 15 or 37:
1. If the reply length matches the length of the corresponding YIELDS items, the reply
is stored in the corresponding items, and the ON ERROR branch is not taken.
2. If the reply length is less than the length of the corresponding YIELDS items, the
reply is stored in the corresponding items, the length of the reply is stored in the
special register TERMINATION-SUBSTATUS, and the program performs ERR-
PARAGRAPH with TERMINATION-STATUS = 11. No error 3115 is logged
because VARYING was specified.
3. If the reply is longer than the corresponding YIELDS items, the reply is truncated
and stored in the corresponding items, TERMINATION-STATUS is set to 11,
TERMINATION-SUBSTATUS is set to the actual reply length up to a maximum of
1 + max(len(msg-a),len(rp-cd)+len(rp-buf-1),len(rp-cd)+len(rp-buf-2)), and the
program performs ERR-PARAGRAPH. In this case an error 3115 is logged.