MOVE QLOCAL on z/OS

Use the MQSC command MOVE QLOCAL to move all the messages from one local queue to another.


Use MQSC commands

For information on how we use MQSC commands, see Performing local administration tasks using MQSC commands.

We can issue this command from sources 2CR. For an explanation of the source symbols, see Use commands on z/OSĀ®.

Synonym: MOVE QL

MOVE QLOCAL

MOVE QLOCAL ( source ) CMDSCOPE(' ')CMDSCOPE(qmgr-name)
  • 1
  • QSGDISP(PRIVATE)QSGDISP(SHARED)1
  • TYPE(MOVE)TYPE(ADD)
  • TOQLOCAL ( target )
  • Notes:

    • 1 Valid only when the queue manager is a member of a queue sharing group.


    Usage notes for MOVE QLOCAL

    1. A typical use of the MOVE QLOCAL command is to move messages from a private queue to a shared queue when you are setting up a queue sharing group environment.
    2. The MOVE QLOCAL command moves messages; it does not copy them.
    3. The MOVE QLOCAL command moves messages in a similar way to an application performing successive MQGET and MQPUT calls. However, the MOVE QLOCAL command does not physically delete logically-expired messages and, therefore, no expiration reports are generated.
    4. The priority, context, and persistence of each message are not changed.
    5. The command performs no data conversion and calls no exits.
    6. Confirm-on-delivery (COD) report messages are not generated but confirm-on-arrival (COA) report messages are. This means that more than one COA report message can be generated for a message.
    7. The MOVE QLOCAL command transfers the messages in batches. At COMMIT time, if the trigger conditions are met, trigger messages are produced. This might be at the end of the move operation. Note: Before the transfer of messages begins, this command verifies that the number of messages on the source queue, when added to the number of messages on the target queue, does not exceed MAXDEPTH on the target queue.

      If the MAXDEPTH of the target queue were to be exceeded, no messages are moved.

    8. The MOVE QLOCAL command can change the sequence in which messages can be retrieved. The sequence remains unchanged only if:

      • You specify TYPE(MOVE) and
      • The MSGDLVSQ parameter of the source and target queues is the same.
    9. Messages are moved within one or more syncpoints. The number of messages in each syncpoint is determined by the queue manager.
    10. If anything prevents the moving of one or more messages, the command stops processing. This can mean that some messages have already been moved, while others remain on the source queue. Some of the reasons that prevent a message being moved are:

      • The target queue is full.
      • The message is too long for the target queue.
      • The message is persistent, but the target queue cannot store persistent messages.
      • The page set is full.


    Parameter descriptions for MOVE QLOCAL

    You must specify the names of two local queues: the one you want to move messages from (the source queue) and the one you want to move the messages to (the target queue).

      source
      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.

      CMDSCOPE
      This parameter specifies how the command runs when the queue manager is a member of a queue sharing group.

        ' '
        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 you are using a queue sharing group environment and if the command server is enabled.

      QSGDISP
      Specifies the disposition of the source queue.

        PRIVATE
        The queue is defined with QSGDISP(QMGR) or QSGDISP(COPY). This is the default value.

        SHARED
        The queue is defined with QSGDISP(SHARED). This is valid only in a queue sharing group environment.

      TYPE
      Specifies how the messages are moved.

        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. This is the default value.

        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.

      target
      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 that 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 specified for the source queue on the QSGDISP 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 TYPE(MOVE), the command fails if the target queue already contains one or more messages.

      The DEFTYPE, HARDENBO, and USAGE parameters of the target queue must be the same as those of the source queue.