IBM Support

How do you tell if there are uncommitted messages on an IBM MQ queue?

Question & Answer


Question

In IBM MQ, the MQGET or MQPUT of a message is uncommitted if the operation is done within syncpoint (MQGMO_SYNCPOINT or MQPMO_SYNCPOINT), and the unit of work is not committed. How do you tell if there are uncommitted messages on a queue?

Answer

  • Display the curdepth of the queue. If it is nonzero, but you cannot browse or get a message, the MQPUT of one or more messages is not committed. The queue depth includes the MQPUT of both committed messages and uncommitted messages. Uncommitted MQGETs do not count toward the CURDEPTH value.
  • As an alternative to browsing the queue, you can display the UNCOM attribute by using the DISPLAY QSTATUS command.

You can display the curdepth and uncommitted (uncom) status of a queue in the following ways:

Distributed platforms

In runmqsc, issue the command:


DIS QS(qname) CURDEPTH UNCOM

* The sample browse program is amqsbcg.


IBM i platform
  • DSPMQMQ QNAME(qname) MQMNAME(qmgr_name)
    where "qname" and "qmgr_name" are substituted with the appropriate names.
    "Current queue depth" is on the first panel.

OR
  • WRKMQMQ QNAME(*ALL) QTYPE(*ALL) MQMNAME(qmgr_name)
    The Depth column is on the resulting panel.

OR
  • From the WRKMQM panel, select option 26=MQSC for the appropriate queue manager to access the runmqsc panel. Enter
    DIS QS(qname) CURDEPTH UNCOM


* The sample browse program is panel WRKMQMMSG
 

z/OS platform

1) Using the CSQOREXX panels, do a display of object type QUEUE. On the resulting screen, hit F11 for status. The resulting screen has columns for "Depth" and "Uncommitted messages"

OR

2) Through the command line in the console or the equivalent. Issue


/cpf DIS QS(qname) CURDEPTH UNCOM

where "cpf" is the Command Prefix for the queue manager's subsystem and "qname" is the name of the queue to display.

* The sample browse programs are:

Reference
The DISPLAY QSTATUS parameters:
  • CURDEPTH
    The current depth of the queue, that is, the number of messages on the queue.

    UNCOM
    Indicates whether there are any uncommitted changes (puts and gets) pending for the queue. The value displayed is one of the following:

    YES There are uncommitted changes pending.

    NO There are no uncommitted changes pending.

    For shared queues, the value returned applies only to the queue manager generating the reply. The value does not apply to all the queue managers in the queue-sharing group.

[{"Type":"MASTER","Line of Business":{"code":"LOB45","label":"Automation"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSYHRD","label":"IBM MQ"},"ARM Category":[{"code":"a8m3p000000PCH0AAO","label":"Administration"}],"ARM Case Number":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All Versions"}]

Product Synonym

IBM MQ WebSphere MQ WMQ

Document Information

Modified date:
12 July 2023

UID

swg21181397