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

Procedure Division
HP NonStop Pathway/iTS SCREEN COBOL Reference Manual426750-003
6-41
DIALOG-BEGIN
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 a server process of the server class SALARY-UPDATE, and the requester waits
for a reply.
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. For the standard system action, see Action Without
ON ERROR description of the corresponding TERMINATION-STATUS register
value.
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 = 11
TERMINATION-SUBSTATUS = min (
rcvlen
, 1+max(
sndlen
,
maxyldlen
) )
where:
rcvlen
is the length of the message from the server.
sndlen
is the length of the message sent to the server.
maxyldlen
is the longest total reply area of any YIELDS clause in the DIALOG-
BEGIN verb.
For a DIALOG-BEGIN, the PATHTCP4 allocates a Pathsend 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
Pathsend buffer as in these cases: