CLEAR QLOCAL

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


Use MQSC commands

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

We can issue this command from sources 2CR. For an explanation of the source symbols, see Sources from which we can issue MQSC commands on z/OS .

Synonym: CLEAR QL


CLEAR QLOCAL

CLEAR QLOCAL ( q-name ) CMDSCOPE(' ')CMDSCOPE(qmgr-name)1CMDSCOPE(*)2QSGDISP(PRIVATE)QSGDISP(SHARED)12Notes:

  • 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

We must specify which local queue we 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.

    CMDSCOPE
    This parameter applies to z/OS only and specifies how the command runs 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 runs on the queue manager on which it was entered. This is the default value.

      qmgr-name
      The command runs on the queue manager you specify, providing the queue manager is active within the queue sharing group.

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

      *
      The command runs 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.

    QSGDISP
    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).

Parent topic: MQSC commands


Related information