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-73
SEND Statement
For a SEND the TCP allocates a WRITEREAD buffer of length
1 + max(<sndlen>,<maxyldlen>). The value of TERMINATION-SUBSTATUS depends
on the length of the actual reply, the length of the YIELDS buffer, and the length of the
WRITEREAD buffer as follows:
Case 1: server reply shorter than YIELDS buffer. In this case TERMINATION-
SUBSTATUS = server reply length.
Case 2: server reply length = YIELDS buffer length. In this case TERMINATION-
SUBSTATUS is undefined. This case does not cause the TCP to invoke the ON
ERROR clause.
Case 3: server reply longer than YIELDS buffer but shorter than WRITEREAD
buffer. In this case TERMINATION-SUBSTATUS = server reply length.
Case 4: server reply longer than YIELDS buffer but = WRITEREAD buffer length.
In this case TERMINATION-SUBSTATUS = server reply length.
Case 5: server reply longer than YIELDS buffer and longer than WRITEREAD
buffer. In this case TERMINATION-SUBSTATUS = WRITEREAD buffer length.
Unspecified Reply Codes
In the following example a reply code other than 1 or 2 (in the first two bytes of the
reply) causes error 3112 (REPLY NUMBER NOT KNOWN TO PROGRAM) to be
logged, and causes the terminal to be suspended. If a reply code of 1 or 2 is received,
but the reply length does not match the length of rply-1 or rply-2, respectively, error
3115 (TRANSACTION REPLY SIZE INVALID) is logged, and the terminal is
suspended because there is no ON ERROR clause.
SAMPLE-PARAGRAPH-1.
SEND msg-a TO srvr-x
REPLY CODE 1 YIELDS rply-1
CODE 2 YIELDS rply-2.
Occasionally an application may choose not to specify all reply codes. For example, the
following requester accepts any value in the first two bytes of the reply without logging
error 3112.
PERFORM SAMPLE-PARAGRAPH-2.
:
SAMPLE-PARAGRAPH-2.
SEND msg-a TO srvr-x
REPLY CODE OTHER YIELDS VARYING rply-a
ON ERROR
PERFORM ERR-FILTER.
ERR-FILTER.
IF TERMINATION-STATUS = 11 PERFORM var-len-reply-rcd
ELSE PERFORM genuine-reply-error.
VAR-LEN-REPLY-RCD.
MOVE TERMINATION-SUBSTATUS TO rply-length.
GENUINE-REPLY-ERROR.
DISPLAY TERMINATION-STATUS.