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

Procedure Division
HP NonStop Pathway/iTS SCREEN COBOL Reference Manual426750-003
6-117
SEND MESSAGE Statement
send-message
considerations:
°
If
send-message
identifies a message template in the Message Section, the
data is obtained from the data item specified in the FROM or USING clause of
the message, is converted and edited according to the message definition, and
is then sent to the intelligent device.
°
If
send-message
identifies an 01 level data item in Working-Storage, the data
is neither validated nor converted but is sent as is to the device, unless the
USER CONVERSION clause is included.
°
If
send-message
identifies a variable-length data item (described with an
OCCURS DEPENDING ON clause), it sends only the number of characters up
to and including the current number of occurrences.
reply-message
considerations:
°
If
reply-message
is the name of a message template, the value of the
message is validated according to the message-field definition, converted to
the format of the Working-Storage data item in the TO or USING clause, and
then moved to that data item.
°
If
reply-message
is the name of a level 01 Working-Storage item, the data
from the intelligent device is neither validated nor converted but is moved as is
to the data item, unless you specify a USER CONVERSION clause.
°
All the
reply-messages
in any one SEND MESSAGE statement must have
the same format: FIXED, VARYING1, VARYING2, DELIMITED, or FIXED-
DELIMITED.
°
If there is only one
reply-message
, you need not specify a
reply-code
.
°
When the TCP receives a reply from the intelligent device, it checks for a
reply-code
in the message or data item. The
reply-code
value indicates
which
reply-message
was returned.
°
The
reply-code
is located either at the location indicated by
code-field
or, if
code-field
is omitted, in the first two bytes of the message or data
item.
°
Each
reply-code
is associated with a value in the special register
TERMINATION-STATUS. TERMINATION-STATUS is set to a number
corresponding to the position of each
reply-code
in the list of
reply-code
values, starting at position number 1.
°
A
reply-message
can be associated with more than one
reply-code
.
Each
reply-code
corresponds to a unique setting for TERMINATION-
STATUS regardless of whether the
reply-code
yields the same or a different
reply-message
.
°
If a
code-field
is specified, a
reply-message
is selected by comparing
each
reply-code
with the
code-field
according to the standard SCREEN