Command reference / msg
DSPMSG
Display Messages
Used by the display station user to show the messages received at the specified message queue. If the message queue is not allocated to the job running the command or to any other job, the command allocates it implicitly for its duration. When messages are shown, options also let the user remove one or more messages from the queue or reply to each inquiry message. The QSYS2.MESSAGE_QUEUE_INFO view returns similar information.
Allowed environments: *ALL.
Positional parameters: 1.
Restrictions
- DSPMSG cannot be used when another job has allocated the message queue with ALCOBJ in the *EXCL lock state.
- When the message queue is in *BREAK or *NOTIFY mode for another job, DSPMSG lets the user see but not remove messages for the job.
- When the queue is in *BREAK mode for another job, the break handling program decides whether inquiry messages can be answered: PGM(*DSPMSG) allows replies, while PGM(user-program) does not.
- If several jobs show and reply to the same inquiry message, only the first reply is valid; later replies cause error messages.
Parameters
MSGQ
Message queue
Specifies the message queue from which messages are shown. The special values *WRKSTN and *WRKUSR should be specified only in an interactive job.
Suggested / special values:
*WRKUSR, *SYSOPR, *USRPRF, *WRKSTN
*WRKUSR- Messages are shown from the work station's message queue if it has any, then from the current user profile message queue.
*SYSOPR- Messages from the system operator message queue (QSYSOPR) are shown.
*WRKSTN- Messages are shown from the work station's own message queue.
*USRPRF- Messages from the current user profile message queue are shown.
*LIBL- All libraries in the library list for the current thread are searched until the first match is found.
*CURLIB- The current library for the job is used to locate the message queue; if none, QGPL is used.
Qualified parts (object, then library; write LIBRARY/OBJECT)
Message queue
Message queue
Library
Library
Suggested / special values:
*LIBL, *CURLIB
OUTPUT
Output
Specifies whether the output from the command is displayed at the requesting work station or printed with the job's spooled output.
Allowed values:
*, *PRINT, *PRTWRAP
*- The output is shown (if requested by an interactive job) or printed with the job's spooled output (if requested by a batch job). Immediate messages can be 512 bytes long.
*PRINT- The output is printed with the job's spooled output, one line per message containing the first 105 bytes of the first level message text.
*PRTWRAP- The output is printed with the job's spooled output; messages that do not fit on one line wrap onto additional lines, up to 512 bytes of first level message text.
MSGTYPE
Message type
Specifies the type of messages in the message queue that are shown.
Allowed values:
*ALL, *INFO, *INQ, *COPY
*ALL- All messages in the message queue are shown.
*INFO- Only informational messages (those not requiring a reply) are shown.
*INQ- Only inquiry messages (those requiring a reply) are shown.
*COPY- Copies of inquiry messages sent to other message queues that still require replies are shown.
START
Messages to display first
Specifies whether the newest or the oldest messages in the message queue are shown first. This parameter is ignored if the output is directed to a spooled printer file.
Allowed values:
*LAST, *FIRST
*LAST- The newest message is shown first.
*FIRST- The oldest message is shown first.
SEV
Severity code filter
Specifies the lowest severity level that a message can have and still be delivered to a user in break or notify mode. Messages below that severity are held in the queue until shown by DSPMSG.
Suggested / special values:
*MSGQ
*MSGQ- All messages with a severity code greater than or equal to the severity code specified for the message queue are shown.
ASTLVL
Assistance level
Specifies which user interface to display.
Allowed values:
*PRV, *USRPRF, *BASIC, *INTERMED
*PRV- The previous user interface used is displayed.
*USRPRF- The user interface stored in the current user profile is used.
*BASIC- The Operational Assistant user interface is used.
*INTERMED- The system user interface is used.
Examples
DSPMSG
Displays messages in the requester's work station message queue, followed by the user profile message queue. If there are no messages in the work station queue, the user profile message queue is shown immediately.
DSPMSG MSGQ(SMITH) MSGTYPE(*INFO)
Displays, at the requester's work station, any informational messages in the message queue named SMITH.
Generated from os/cl/catalog/DSPMSG.json and os/cl/help/DSPMSG.json.