+

Search Tips | Advanced Search

Clearing a local queue with CLEAR QLOCAL

We can use the CLEAR QLOCAL command to clear a local queue.


Before starting

We cannot clear a queue if:

  • There are uncommitted messages that have been put on the queue under sync point.
  • An application currently has the queue open.


About this task

To clear a local queue by using the CLEAR QLOCAL command, the name of the queue must be defined to the local queue manager.

Note: There is no prompt that enables you to change your mind; once you press the Enter key the messages are lost.


Procedure

To clear the messages from a local queue, use the CLEAR QLOCAL as shown in the following example. In this example, all the messages are deleted from a local queue called MAGENTA.QUEUE:
CLEAR QLOCAL (MAGENTA.QUEUE)
Parent topic: Work with local queues


Related information

Last updated: 2020-10-04