CLEAR QLOCAL

Use the MQSC command CLEAR QLOCAL to clear the messages from a local queue.

Using MQSC commands

For information on how you use MQSC commands, see Performing local administration tasks using MQSC commands.

IBM® i UNIX and Linux® Windows z/OS®
X X X 2CR

For an explanation of the symbols in the z/OS column, see Using commands on z/OS.

Synonym: CLEAR QL

CLEAR QLOCAL

Read syntax diagramSkip visual syntax diagram CLEAR QLOCAL ( q-name ) CMDSCOPE(' ')CMDSCOPE(qmgr-name)1CMDSCOPE(*)2QSGDISP(PRIVATE)QSGDISP(SHARED)12
Notes:
  • 1 Valid only on z/OS when the queue manager is a member of a queue-sharing group.
  • 2 Valid only on z/OS.

Parameter descriptions for CLEAR QLOCAL

You must specify which local queue you want to clear.

The command fails if either:
  • The queue has uncommitted messages that have been put on the queue under syncpoint
  • The queue is currently open by an application (with any open options)
If an application has this queue open, or has a queue open that eventually resolves to this queue, the command fails. The command also fails if this queue is a transmission queue, and any queue that is, or resolves to, a remote queue that references this transmission queue, is open.
(q-name)
The name of the local queue to be cleared. The name must be defined to the local queue manager.
[z/OS]CMDSCOPE
[z/OS] This parameter applies to z/OS only and specifies how the command is executed when the queue manager is a member of a queue-sharing group.
CMDSCOPE must be blank, or the local queue manager, if QSGDISP is set to SHARED.
' '
The command is executed on the queue manager on which it was entered. This is the default value.
qmgr-name
The command is executed on the queue manager you specify, providing the queue manager is active within the queue-sharing group.

You can specify a queue manager name, other than the queue manager on which the command was entered, only if you are using a queue-sharing group environment and if the command server is enabled.

*
The command is executed on the local queue manager and is also passed to every active queue manager in the queue-sharing group. The effect of this is the same as entering the command on every queue manager in the queue-sharing group.
[z/OS]QSGDISP
[z/OS] Specifies whether the queue definition is shared. This parameter applies to z/OS only.
PRIVATE
Clear only the private queue named q-name . The queue is private if it was defined using a command that had the parameters QSGDISP(COPY) or QSGDISP(QMGR). This is the default value.
SHARED
Clear only the shared queue named q-name . The queue is shared if it was defined using a command that had the parameters QSGDISP(SHARED).