Pathway/iTS TCP and Terminal Programming Guide
Programming for Intelligent Devices
Compaq NonStop™ Pathway/iTS TCP and Terminal Programming Guide—426751-001
6-2
The SEND MESSAGE Statement
The SEND MESSAGE Statement
The SEND MESSAGE statement moves data from working storage to an external 
process (outside the PATHMON environment). The associated REPLY statement 
accepts data from the external process and moves it into working storage.
Besides moving the data, both the SEND MESSAGE statement and its REPLY 
statement edit and convert the individual data fields according to the pertinent 
PICTURE clauses in the Working-Storage Section and the Message Section data 
declarations.
The SEND MESSAGE statement also allows you to use the gather-write capability 
(whereby individual items in the outgoing message are extracted from noncontiguous 
locations in working storage). The associated REPLY statement allows you to use the 
scatter-read capability (whereby individual items in the incoming message are stored 
into noncontiguous locations in working storage).
When you send data to the process or device, you can use only a single message 
template. When you receive data from the process or device, however, you can do so 
through any of several input message templates. You use the REPLY CODE and 
YIELDS clauses with the SEND MESSAGE statement to determine which input 
message template the response has been mapped through.
You code SEND MESSAGE statements in a manner similar to the way in which you 
code SEND statements (by using REPLY CODE and YIELDS clauses and the 
TERMINATION-STATUS register).  An example of the use of the SEND MESSAGE 
statement is as follows:
SEND MESSAGE MSG-3-OUT
 REPLY CODE FIELD IS WS-MSG-IN-CODE
 CODE 1 YIELDS MSG-3-IN
 CODE 2 YIELDS MSG-4-IN
 CODE 3 YIELDS MSG-3-IN
 CODE 4 YIELDS MSG-4-IN
 ON ERROR PERFORM IDS-SERVER-SEND-ERROR.
PERFORM ONE OF
 PROC-MSG-3-IN
 PROC-MSG-4-IN
 PROC-MSG-3-IN
 PROC-MSG-4-IN
 DEPENDING ON TERMINATION-STATUS.










