+

Search Tips | Advanced Search

Delete a local queue with DELETE QLOCAL

We can use the MQSC command DELETE QLOCAL to delete a local queue.


About this task

A queue cannot be deleted if it contains uncommitted messages.

If a queue has one or more committed messages and no uncommitted messages, it can be deleted only if we specify the PURGE option. The deletion then goes ahead even if there are committed messages on the named queue, and these messages are also purged.

Specify NOPURGE instead of PURGE ensures that the queue is not deleted if it contains any committed messages.


Procedure

To delete a local queue, use the DELETE QLOCAL command as shown in the following example. This example deletes the queue PINK.QUEUE if there are no committed messages on the queue:
DELETE QLOCAL (PINK.QUEUE) NOPURGE
This example deletes the queue PINK.QUEUE even if there are committed messages on the queue:
DELETE QLOCAL (PINK.QUEUE) PURGE
Parent topic: Work with local queues


Related information

Last updated: 2020-10-04