Move Queue on z/OSĀ®
The Move Queue (MQCMD_MOVE_Q) command moves all the messages from one local queue to another.
Required parameters
- FromQName (MQCFST)
- From queue name (parameter identifier: MQCACF_FROM_Q_NAME).
The name of the local queue from which messages are moved. The name must be defined to the local queue manager.
The command fails if the queue contains uncommitted messages.
If an application has this queue open, or has open a queue that eventually resolves to this queue, the command fails. For example, the command 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.
An application can open this queue while the command is in progress but the application waits until the command has completed.
The maximum length of the string is MQ_Q_NAME_LENGTH.
Optional parameters (Move Queue)
- CommandScope (MQCFST)
- Command scope (parameter identifier: MQCACF_COMMAND_SCOPE).
Specifies how the command is executed when the queue manager is a member of a queue-sharing
group. We 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.
The maximum length is MQ_QSG_NAME_LENGTH.
- MoveType (MQCFIN)
- Move type (parameter identifier: MQIA_QSG_DISP).
Specifies how the messages are moved. The value can be any of the following values:
- MQIACF_MOVE_TYPE_MOVE
- Move the messages from the source queue to the empty target queue.
The command fails if the target queue already contains one or more messages. The messages are deleted from the source queue. MQIACF_MOVE_TYPE_MOVE is the default value.
- MQIACF_MOVE_TYPE_ADD
- Move the messages from the source queue and add them to any messages already on the target
queue.
The messages are deleted from the source queue.
- QSGDisposition (MQCFIN)
- Disposition of the object within the group (parameter identifier: MQIA_QSG_DISP).
Specifies the disposition of the object for which information is to be returned (that is, where
it is defined and how it behaves). The value can be any of the following values:
- MQQSGD_PRIVATE
- The object is defined as either MQQSGD_Q_MGR or MQQSGD_COPY. MQQSGD_PRIVATE is the default value.
- MQQSGD_SHARED
- The object is defined as MQQSGD_SHARED. MQQSGD_SHARED is valid only in a shared queue environment.
- ToQName (MQCFST)
- To queue name (parameter identifier: MQCACF_TO_Q_NAME).
The name of the local queue to which messages are moved. The name must be defined to the local queue manager.
The name of the target queue can be the same as the name of the source queue only if the queue exists as both a shared and a private queue. In this case, the command moves messages to the queue that has the opposite disposition (shared or private) from that disposition specified for the source queue on the QSGDisposition parameter.
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.
No application can open this queue while the command is in progress.
If you specify a value of MQIACF_MOVE_TYPE_MOVE on the MoveType parameter, the command fails if the target queue already contains one or more messages.
The DefinitionType, HardenGetBackout, Usage parameters of the target queue must be the same as those parameters of the source queue.
The maximum length of the string is MQ_Q_NAME_LENGTH.