Pathway/iTS SCREEN COBOL Reference Manual (H06.10+, J06.03+)
Procedure Division
HP NonStop Pathway/iTS SCREEN COBOL Reference Manual—426750-003
6-99
SEND Statement
In the SEND statement, the position of a reply code affects the value set for the
TERMINATION-STATUS special register as illustrated in the following example:
SEND HEADER, LASTNAME OF EMP-REC TO "PERS-DEPT"
REPLY CODE 1, 21, 31 YIELDS R-CODE, NEW-SALARY
CODE 2, 42, 62 YIELDS NEW-RATE, STOCK-OPTION, BENEFIT
CODE 0, 200 YIELDS TERMINATION-NOTICE
ON ERROR PERFORM SERVER-LIST.
In this example, the positions of the reply codes cause these corresponding values to
be set for TERMINATION-STATUS:
Consider the following example of the SEND statement:
77 YEARLY-REVIEW PIC 999 VALUE 3.
:
MOVE YEARLY-REVIEW TO TRANSCODE OF HEADER.
SEND HEADER, LASTNAME OF PERSONAL-REC TO "SALARY-UPDATE"
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 executed as follows:
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-SALARY-
CODE, 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
Reply Code TERMINATION-STATUS
1 1
21 2
31 3
2 4
42 5
62 6
0 7
200 8










