Clearing a local queue with CLEAR QLOCAL

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

Before you begin

You 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

If you want 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)