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

Procedure Division
HP NonStop Pathway/iTS SCREEN COBOL Reference Manual426750-003
6-54
DIALOG-SEND
Consider this example of the DIALOG-BEGIN statement:
77 YEARLY-REVIEW PIC 999 VALUE 3. :
MOVE YEARLY-REVIEW TO TRANSCODE OF HEADER.
DIALOG-SEND HEADER, LASTNAME OF PERSONAL-REC
REPLY CODE 1 YIELDS R-CODE, NEW-SALARY-CODE
CODE 2 YIELDS R-CODE, NEW-SALARY, STOCK-OPTION
CODE 0 YIELDS R-CODE, TERMINATION-NOTICE
ON ERROR PERFORM SERVER-DUMB.
The example is run as:
1. The transaction message is constructed using the values of HEADER and
LASTNAME from the SCREEN COBOL program data area. This message is sent
to the server process previously identified by a successful DIALOG-BEGIN
statement.
2. When the reply arrives, the reply is identified and moved into NEW-
SALARYCODE, NEW-SALARY and STOCK-OPTION, or TERMINATION-
NOTICE, depending on the reply code. The number moved into special register
TERMINATION-STATUS will be 1, 2, or 3, depending on the reply code received
from the server.
3. The ON ERROR clause takes special action if a problem occurs in sending the
message. The possible problems include a freeze on the server class, the
unavailability of an appropriate server, and an unrecognizable reply from the
server. If such a condition arises, TERMINATION-STATUS is set to a value
indicating the type of error, and the imperative statement PERFORM SERVER-
DUMB is run.
4. If the ON ERROR clause has not been included and an error occurs, the standard
system action is performed as mentioned below.
Variable Reply Length
The ON ERROR clause prevents the requester from being suspended when the reply
length does not match the YIELDS buffer length. In this case, when the TCP runs the
ON ERROR clause, it also sets the SCREEN COBOL special registers
TERMINATION-STATUS and TERMINATION-SUBSTATUS as:
TERMINATION-STATUS = 11TERMINATION-SUBSTATUS = min(
rcvlen
,
1+max(
sndlen,maxyldlen
) )
where
rcvlen
is the length of the message from server
sndlen
is the length of the message sent to server
maxyldlen
is the longest total reply area of any YIELDS clause in SEND verb.