Where allowed to run: All environments (*ALL) Threadsafe: No |
Parameters Examples Error messages |
The Clear Message Queue (CLRMSGQ) command clears (removes) all messages from a specified message queue. Once cleared, the data can no longer be displayed or printed. If the specified message queue is not allocated to a job, it is implicitly allocated by this command for the duration of the command. If the specified message queue is *WRKSTN or a work station message queue, it is not allocated and the message queue is cleared even if the work station device description is allocated to another job.
Restriction: You must have change (*CHANGE) authority to the message queue and use (*USE) authority to the library where the message queue is stored.
Top |
Keyword | Description | Choices | Notes |
---|---|---|---|
MSGQ | Message queue | Qualified object name | Required, Positional 1 |
Qualifier 1: Message queue | Name, *WRKSTN | ||
Qualifier 2: Library | Name, *LIBL, *CURLIB | ||
CLEAR | Clear | *ALL, *KEEPUNANS | Optional |
Top |
Specifies the message queue to be cleared. If a specific message queue name is specified with a library qualifier of *LIBL, only the first message queue found with that name is cleared.
This is a required parameter.
Qualifier 1: Message queue
Qualifier 2: Library
Top |
Specifies which messages to clear from the message queue.
Top |
Example 1: Clearing All Messages
CLRMSGQ MSGQ(*CURLIB/MQFIN) CLEAR(*ALL)
This command clears all messages from a message queue named MQFIN, which is located in the current library for the job.
Example 2: Keeping Unanswered Messages
CLRMSGQ MSGQ(*CURLIB/MQFIN) CLEAR(*KEEPUNANS)
This command clears all messages except unanswered inquiry messages from a message queue called MQFIN, which is located in the current library for the job.
Top |
Top |