Where allowed to run: All environments (*ALL) Threadsafe: Yes |
Parameters Examples Error messages |
The Send Message (SNDMSG) command is used by a display station user to send an immediate message from his display station to one or more message queues. (An immediate message is a message that is not predefined and is not stored in a message file.) The message can be sent to the system operator, to other display station users, to a user's message queue, all currently active users' message queues or to the system history log, QHST. The sender can require a reply from the message receiver. The primary users of this command are display station users and the system operator.
Restrictions:
Top |
Keyword | Description | Choices | Notes |
---|---|---|---|
MSG | Message text | Character value | Required, Positional 1 |
TOUSR | To user profile | Name, *SYSOPR, *ALLACT, *REQUESTER | Optional, Positional 3 |
TOMSGQ | To message queue | Single values: *SYSOPR Other values (up to 50 repetitions): Qualified object name |
Optional, Positional 2 |
Qualifier 1: To message queue | Name, *HSTLOG | ||
Qualifier 2: Library | Name, *LIBL, *CURLIB | ||
MSGTYPE | Message type | *INFO, *INQ | Optional, Positional 4 |
RPYMSGQ | Message queue to get reply | Single values: *WRKSTN Other values: Qualified object name |
Optional |
Qualifier 1: Message queue to get reply | Name | ||
Qualifier 2: Library | Name, *LIBL, *CURLIB | ||
CCSID | Coded character set ID | 1-65535, *HEX, *JOB | Optional |
Top |
Specifies the immediate message that is being sent. The text must be enclosed in apostrophes if it contains blanks or other special characters. A maximum of 512 characters can be specified.
Coded Character Set Identifier (CCSID) Considerations
The text supplied for the MSG parameter is assumed to be in the CCSID of the job running this command unless the coded character set identifier is supplied for the CCSID parameter. For more information about the message handler and its use of CCSIDs, see the Globalization topic in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter.
This is a required parameter.
Top |
Specifies that the message is to be sent to the message queue specified in the user profile for the user named on this parameter. This parameter cannot be used if a value is specified for the To message queue(TOMSGQ) parameter.
Either this parameter or the To message queue (TOMSGQ) parameter is required.
Top |
Specifies one to fifty message queues to which an informational message is sent. For an inquiry message, one message queue may be specified or two message queues may be specified if one of the queues is *HSTLOG. This parameter cannot be used if a value is specified for the To user profile (TOUSR) parameter.
Either this parameter or the To user profile (TOUSR) parameter is required.
Single values
Qualifier 1: To message queue
Qualifier 2: Library
Top |
Specifies the type of message to be sent. Only an informational or inquiry message can be specified.
Top |
Specifies, only if an inquiry message is sent, the message queue to which a reply is sent.
Single values
Note: This value cannot be specified for batch jobs.
Qualifier 1: Message queue to get reply
Qualifier 2: Library
Top |
Specifies the coded character set identifier (CCSID) that the supplied message text is in. For more information about the message handler and its use of CCSIDs, see the Globalization topic in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter.
Top |
Example 1: Sending Message to User Message Queue
SNDMSG MSG('Do you want to update INV now?') TOUSR(JONES) MSGTYPE(*INQ) RPYMSGQ(SMITH)
This command sends a message to the user message queue JONES. When the message is answered, the reply will be sent to the message queue SMITH.
Example 2: Sending Message to System's History Log
SNDMSG MSG('Errors on PAYROLL cost me 1 hour of run time.') TOMSGQ(QHST)
This command is used by the system operator to send an informational message to the system's history log, QHST, through the log's message queue, which has the same name.
Example 3: Sending Message to System Operator
SNDMSG MSG('Please make 2 copies of file LABORSTAT.') TOMSGQ(QSYSOPR)
This command shows a typical use of the SNDMSG command by a display station user. The user is sending the message to the system operator.
Example 4: Sending Message that Requires a Reply
SNDMSG MSG ('How long will the system be up today?') TOMSGQ(*SYSOPR) MSGTYPE(*INQ)
This command sends an inquiry message to the system operator. The message requires a reply. The system operator displays the message by using the DSPMSG command and enters the reply on the display. The reply is then sent to the display station user's work station message queue. The display station user enters another DSPMSG command to display the reply.
Top |
*ESCAPE Messages
Top |