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-85
SEND MESSAGE Statement
•
Execution considerations:
°
Pathway/iTS does not buffer multiple messages. Each message is transmitted to
the intelligent device when SEND MESSAGE is executed.
°
SCREEN COBOL programs handle synchronization of messages between the
program and the intelligent device. This means that the program must detect
duplicate messages from the intelligent device.
°
Pathway/iTS does no checkpointing when SEND MESSAGE is executed.
Consider the following SCREEN COBOL example with multiple reply messages:
DATA DIVISION.
WORKING-STORAGE SECTION.
77 INQUIRY PIC X(12).
01 MESSAGE-REPLY-OK.
03 REPLY-CODE-FIELD PIC X(2).
03 REPLY-OK PIC X(130).
01 MESSAGE-REPLY-NOGOOD.
03 REPLY-CODE-FIELD PIC X(2).
03 REPLY-NG PIC X(14).
MESSAGE SECTION.
01 INTELLIGENT-MESSAGE-INQ PIC X(12) FROM INQUIRY.
PROCEDURE DIVISION.
SEND MESSAGE INTELLIGENT-MESSAGE-INQ
REPLY CODE FIELD IS REPLY-CODE-FIELD OF MESSAGE-REPLY-OK
CODE "A1", "B1", "C1" YIELDS MESSAGE-REPLY-OK
CODE "A2", "B2", "C2" YIELDS MESSAGE-REPLY-NOGOOD
ON-ERROR PERFORM DEVICE-DUMB.
This SEND MESSAGE statement executes as follows:
1. It constructs the message using the message template called INTELLIGENT-
MESSAGE-INQ from the Working-Storage data item INQUIRY. It sends the
message to the intelligent device or process and waits for a reply.
2. When the reply arrives, it moves the reply either to MESSAGE-REPLY-OK or
to MESSAGE-REPLY-NOGOOD, depending on the reply code value. It moves
a number from 1 to 6 into the TERMINATION-STATUS register based on the
position of the reply code in the SEND MESSAGE statement. In this example,
the special register TERMINATION-STATUS is set as follows:
REPLY CODE TERMINATION-STATUS
A1 1
B1 2
C1 3
A2 4
B2 5
C2 6