Previous Topic: ROLLBACKNext Topic: SET TIMER (DC/UCF)


SEND MESSAGE (DC/UCF)

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.

Syntax
►►─── 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) ───┘
Parameters
ONLY/ALWAYS

Specifies whether the system is to queue the message if the specified destination, user, or terminal is not currently available:

ONLY

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.

ALWAYS

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.

TO

Specifies the destination, user, or logical terminal to receive the message:

DEST ID (destination-id)

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.

USER ID (user-id)

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.

LTERM ID (lterm-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.

FROM (message-location)

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:

TO (end-message-location)

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.

LENGTH (message-length)

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.

Examples

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);
Status Codes

Upon completion of the SEND MESSAGE function, the ERROR_STATUS field in the IDMS DC communications block indicates the outcome of the operation:

0000

The request has been serviced successfully.

4907

An I/O error has occurred during processing.

4921

The specified message recipient has not been defined.

4931

The parameter list is invalid.

4932

The derived length of the specified message data area is zero or negative.

4938

The specified program variable storage has not been allocated, as required. A GET STORAGE request must be issued.