Command reference / msg

CLRMSGQ

Clear Message Queue

Removes messages from a queue. The cleared messages are no longer available for display or printing.

Allowed environments: *ALL. Positional parameters: 2.

Parameters

MSGQ Message queue

Sets 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.

Type
*QUAL
Required
Yes
Case
Uppercase
*WRKSTN
The work station message queue is cleared. This is not allowed in batch mode.
message-queue-name
Enter the name of the message queue to be cleared.
*LIBL
Look in the thread's library list.
*CURLIB
The current library for the thread is searched to locate the message queue to be cleared. If no current library exists in the library list, the QGPL library is used.
library-name
Enter a library name where the message queue is located. Only the library named in this parameter is searched.
Qualified parts (object, then library; write LIBRARY/OBJECT)

Message queue Message queue

Type
*NAME
Required
No
Length
10
Case
Uppercase

Suggested / special values: *WRKSTN

Library Library

Type
*NAME
Required
No
Default
*LIBL
Length
10
Case
Uppercase

Suggested / special values: *LIBL, *CURLIB

CLEAR Clear

Select which messages to clear from the message queue.

Type
*CHAR
Required
No
Default
*ALL
Length
10
Case
Uppercase

Allowed values: *ALL, *KEEPUNANS

*ALL
Clears all messages on the message queue. If there are any unanswered messages on the queue, the default reply for the message is sent before the message is removed.
*KEEPUNANS
All messages except unanswered inquiry messages and sender copy messages are removed from the specified message queue.

Examples

CLRMSGQ MSGQ(*CURLIB/MQFIN) CLEAR(*ALL)

Clears all messages from a message queue named MQFIN, which is located in the current library for the job.

CLRMSGQ MSGQ(*CURLIB/MQFIN) CLEAR(*KEEPUNANS)

Clears all messages except unanswered inquiry messages from a message queue called MQFIN, which is located in the current library for the job.

IBM command documentation

Generated from os/cl/catalog/CLRMSGQ.json and os/cl/help/CLRMSGQ.json.