The SEND MESSAGE statement sends a message to another terminal or user or to a group of terminals or users defined as a destination during system generation. The SEND MESSAGE function does not employ the data dictionary message area; instead, the system places each message in a queue, sending the message to the appropriate terminal only when it is possible to do so without disrupting executing tasks. Typically, the system sends queued messages to a terminal the next time the ENTER NEXT TASK CODE message is displayed.
►►─── SEND MESSAGE ─┬──────────┬─ TO ─┬─ DEST ID (destination-id) ─┬──────────► ├─ ONLY ◄ ─┤ ├─ USER ID (user-id) ────────┤ └─ ALWAYS ─┘ └─ LTERM ID (lterm-id) ──────┘ ►─── FROM (message-location) ─┬─ TO (end-message-location) ─┬─ ; ────────────►◄ └─ LENGTH (message-length) ───┘
Specifies whether the system is to queue the message if the specified destination, user, or terminal is not currently available:
Sends the message immediately if the destination, user, or terminal is available, and not to queue the message for subsequent transmission if the destination, user, or terminal is not available.
Note: If ONLY is specified with the DEST ID option (described below) and if some, but not all, of a group of users or terminals in the destination are available, the system will send the message to those available. The sender will not be aware of any unsuccessful transmissions.
Sends the message immediately if the destination, user, or terminal is available, and to queue the message for later transmission if the destination, user, or terminal is not available.
Specifies the destination, user, or logical terminal to receive the message:
Identifies the recipient of the message as a destination. The specified destination must have been defined during system generation. Destination-id is either the symbolic name of a user-defined field that contains the destination ID or the ID itself enclosed in quotation marks.
Identifies the user to receive a message. The specified user can be signed on to any terminal. User-id is the symbolic name of a user-defined field that contains the user ID.
Identifies the logical terminal to receive the message. Lterm-id is either the symbolic name of a user-defined field that contains the terminal ID or the id itself enclosed in quotation marks.
Specifies the program variable-storage entry that contains the text of the message to be sent. Message-location is the symbolic name of a user-defined field. The length of the message text is determined by one of the following specifications:
Indicates the end of the program variable-storage entry that contains the message text and is specified following the last field in message-location. End-message-location is the symbolic name of either a user-defined dummy byte field or a field that contains a data item not associated with the message text.
Defines the length, in bytes, of the message text. Message-length is either the symbolic name of a user-defined field that contains the length or the length itself expressed as a numeric constant.
The following statement sends the message in the TERM_MESS field to the logical terminal KENNEDYA:
SEND MESSAGE ALWAYS
TO LTERM ID ('KENNEDYA')
FROM (TERM_MESS) TO (END_TERM_MESS);
The following statement sends the message in the TERM_MESS field to the user KYJOE2:
SEND MESSAGE
TO USER ID ('KYJOE2')
FROM (TERM_MESS) TO (END_TERM_MESS);
The following statement sends the message in the TERM_MESS field to the destination ALL:
SEND MESSAGE
TO DEST ID ('ALL')
FROM (TERM_MESS) TO (END_TERM_MESS);
Upon completion of the SEND MESSAGE function, the ERROR_STATUS field in the IDMS DC communications block indicates the outcome of the operation:
The request has been serviced successfully.
An I/O error has occurred during processing.
The specified message recipient has not been defined.
The parameter list is invalid.
The derived length of the specified message data area is zero or negative.
The specified program variable storage has not been allocated, as required. A GET STORAGE request must be issued.
|
Copyright © 2014 CA.
All rights reserved.
|
|