Delete Queue

The Delete Queue (MQCMD_DELETE_Q) command deletes a queue.

HP Integrity NonStop Server UNIX and Linux® Windows
X X X

Required parameters

QName (MQCFST)
Queue name (parameter identifier: MQCA_Q_NAME).

The name of the queue to be deleted.

If the Scope attribute of the queue is MQSCO_CELL, the entry for the queue is deleted from the cell directory.

The maximum length of the string is MQ_Q_NAME_LENGTH.

Optional parameters

Authrec (MQCFIN)
Authrec (parameter identifier: MQIACF_REMOVE_AUTHREC).

Specifies whether the associated authority record is also deleted.

This parameter does not apply to z/OS®.

The value can be:
MQRAR_YES
The authority record associated with the object is deleted. This is the default.
MQRAR_NO
The authority record associated with the object is not deleted.
CommandScope (MQCFST)
Command scope (parameter identifier: MQCACF_COMMAND_SCOPE). This parameter applies to z/OS only.
Specifies how the command is executed when the queue manager is a member of a queue-sharing group. You can specify one of the following:
  • blank (or omit the parameter altogether). The command is executed on the queue manager on which it was entered.
  • a queue manager name. The command is executed on the queue manager you specify, providing it is active within the queue sharing group. If you specify a queue manager name other than the queue manager on which it was entered, you must be using a queue-sharing group environment, and the command server must be enabled.
  • an asterisk (*). The command is executed on the local queue manager and is also passed to every active queue manager in the queue-sharing group.

The maximum length is MQ_QSG_NAME_LENGTH.

Purge (MQCFIN)
Purge queue (parameter identifier: MQIACF_PURGE).

If there are messages on the queue MQPO_YES must be specified, otherwise the command fails. If this parameter is not present the queue is not purged.

Valid only for queue of type local.

The value can be:
MQPO_YES
Purge the queue.
MQPO_NO
Do not purge the queue.
QSGDisposition (MQCFIN)
Disposition of the object within the group (parameter identifier: MQIA_QSG_DISP). This parameter applies to z/OS only.
Specifies the disposition of the object to which you are applying the command (that is, where it is defined and how it behaves). The value can be:
MQQSGD_COPY
The object definition resides on the page set of the queue manager that executes the command. The object was defined by a command using the parameter MQQSGD_COPY. Any object residing in the shared repository, or any object defined using a command that had the parameters MQQSGD_Q_MGR, is not affected by this command.
MQQSGD_GROUP
The object definition resides in the shared repository. The object was defined by a command using the parameter MQQSGD_GROUP. Any object residing on the page set of the queue manager that executes the command (except a local copy of the object) is not affected by this command.
If the deletion is successful, the following MQSC command is generated and sent to all active queue managers in the queue-sharing group to 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 you specify MQPO_YES for Purge. To delete messages on local copies of the queues, you must explicitly issue, for each copy, the Delete Queue command with a QSGDisposition value of MQQSGD_COPY and a Purge value of MQPO_YES.
MQQSGD_Q_MGR
The object definition resides on the page set of the queue manager that executes the command. The object was defined by a command using the parameter MQQSGD_Q_MGR. Any object residing in the shared repository, or any local copy of such an object, is not affected by this command.

MQQSGD_Q_MGR is the default value.

MQQSGD_SHARED
Valid only for queue of type local.

The object resides in the shared repository. The object was defined by a command using the parameter MQQSGD_SHARED. Any object residing on the page set of the queue manager that executes the command, or any object defined by a command using the parameter MQQSGD_GROUP, is not affected by this command.

QType (MQCFIN)
Queue type (parameter identifier: MQIA_Q_TYPE).

If this parameter is present, the queue must be of the specified type.

The value can be:
MQQT_ALIAS
Alias queue definition.
MQQT_LOCAL
Local queue.
MQQT_REMOTE
Local definition of a remote queue.
MQQT_MODEL
Model queue definition.

Error codes (Delete Queue)

This command might return the following error codes in the response format header, in addition to the values shown in Error codes applicable to all commands.

Reason (MQLONG)
The value can be:
MQRC_Q_NOT_EMPTY
(2055, X'807') Queue contains one or more messages or uncommitted put or get requests.