DELETE queues
Use the MQSC DELETE command to delete a queue definition for a local, model, or remote queue, or a queue alias.
Use MQSC commands
For information on how we use MQSC commands, see Performing local administration tasks using MQSC commands.
This section contains the following 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 .
Usage notes for DELETE queues
- Successful completion of the command does not mean that the action completed. To check for true completion, see the DELETE queues step in Check that async commands for distributed networks have finished.
Parameter descriptions for DELETE queues
- (q-name)
- The name of the queue must be defined to the local queue manager for all the queue types.
For an alias queue this is the local name of the alias queue to be deleted.
For a model queue this is the local name of the model queue to be deleted.
For a remote queue this is the local name of the remote queue to be deleted.
For a local queue this is the name of the local queue to be deleted. We must specify which queue we want to delete.
Note: A queue cannot be deleted if it contains uncommitted messages.If an application has this queue open, or has open a queue 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.
If this queue has a SCOPE attribute of CELL, the entry for the queue is also deleted from the cell directory.
- AUTHREC
- This parameter does not apply to z/OS.
- 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 GROUP or 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.
- PURGE and NOPURGE
- Specifies whether any existing committed messages on the queue named by the DELETE command are to be purged for the delete command to work. The default is NOPURGE.
- PURGE
- The deletion is to go ahead even if there are committed messages on the named queue, and these messages are also to be purged.
- NOPURGE
- The deletion is not to go ahead if there are any committed messages on the named queue.
- QSGDISP
- Specifies the disposition of the object to which we are applying the command (that is, where it is defined and how it behaves). If the object definition is shared, we do not need to delete it on every queue manager that is part of a queue sharing group. (Queue sharing groups are available only on IBM MQ for z/OS.)
- COPY
- The object definition resides on the page set of the queue manager that executes the command. The object was defined using a command that had the parameters QSGDISP(COPY). Any object residing in the shared repository, or any object defined using a command that had the parameters QSGDISP(QMGR), is not affected by this command.
- GROUP
- The object definition resides in the shared repository. The object was defined using a command that had the parameters QSGDISP(GROUP). Any object residing on the page set of the queue manager that executes the command, or any object defined using a command that had the parameters QSGDISP(SHARED), is not affected by this command. If the deletion is successful, the following command is generated and sent to all active queue managers in the queue sharing group to make, or delete, local copies on page set zero:
DELETE queue(q-name) QSGDISP(COPY)or, for a local queue only:DELETE QLOCAL(q-name) NOPURGE QSGDISP(COPY)The deletion of the group object takes effect even if the generated command with QSGDISP(COPY) fails. Note: You always get the NOPURGE option even if we specify PURGE. To delete messages on local copies of the queues, we must explicitly issue the command:DELETE QLOCAL(q-name) QSGDISP(COPY) PURGEfor each copy.
- QMGR
- The object definition resides on the page set of the queue manager that executes the command. The object was defined using a command that had the parameters QSGDISP(QMGR). Any object residing in the shared repository, or any local copy of such an object, is not affected by this command.
This is the default value.
- SHARED
- This option applies only to local queues.
The object definition resides in the shared repository. The object was defined using a command that had the parameters QSGDISP(SHARED). Any object residing on the page set of the queue manager that executes the command, or any object defined using a command that had the parameters QSGDISP(GROUP), is not affected by this command.
Parent topic: MQSC commands