Wednesday, February 5, 2014

How do you tell if there are uncommitted messages on a queue??

Display the curdepth of the queue. If it is non-zero, but you can not browse or get a message, the MQPUT has not been committed.
* The sample browse program is amqsbcg.
iSeries platform
iSeries platform
OR
OR
* The sample browse program is panel WRKMQMMSG 
* The sample browse program is panel WRKMQMMSG 
z/OS platform
where "cpf" is the Command Prefix for the queue manager's subsystem and "qname" is the name of the queue to display.

As an alternative to browsing the queue, you can display the UNCOM attribute using DISPLAY QSTATUS command.
You can display the curdepth and uncommitted (uncom) status of a queue in the following ways:
Distributed platforms
In runmqsc, issue
DIS QS(qname) CURDEPTH UNCOM

DSPMQMQ QUEUE(qname)Curdepth is at the bottom of the last panel.

WRKMQMQ QNAME(*ALL) QTYPE(*ALL) MQMNAME(QMGRNAME)The depth column is on the resulting panel.

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


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 joblog. Issue
/cpf DIS QS(qname) CURDEPTH UNCOM


==> Now display the queue status "type(handle) all" if there are uncommitted messages on the queue to determine which application has the queue open for output:

DISPLAY QSTATUS(TEST.QUEUE) TYPE(HANDLE) ALL
This displays an output with the PID and this:
AMQ8450: Display queue status details.                                
   QUEUE(TEST.QUEUE)    TYPE(HANDLE)               
   APPLDESC( )                             APPLTAG(myput.sol)         
   APPLTYPE(USER)                          BROWSE(NO)                 
   CHANNEL( )                           CONNAME( )                 
   ASTATE(NONE)                            HSTATE(INACTIVE)           
   INPUT(NO)                               INQUIRE(NO)                
   OUTPUT(YES)                             PID(26066)                 
   QMURID(0.6007)                          SET(NO)                    
   TID(1)                                                             
   URID(XA_FORMATID[00000000] XA_GTRID[] XA_BQUAL[]) URTYPE(QMGR)
USERID(userID2)             
                                                                     
The above example shows that the application "myput.sol" (attributr APPLTAG) has the queue open for output. If it were a client, the application name shown in APPLTAG would be "amqrmppa".
                                                                     
==> Using the value for the attribute PID from the previous command (in this case is 26066), then find the connection details by displaying the connections that match the PID.

  DISPLAY CONN(*) ALL WHERE(PID EQ 26066)
AMQ8276: Display Connection details.                                  
   CONN(515C36C720002C01)                                             
   EXTCONN(414D5143514958312020202020202020)                          
   TYPE(CONN)                                                         
   PID(26066)                              TID(1)         
APPLDESC( )                             APPLTAG(myput.sol)
   APPLTYPE(USER)                          ASTATE(NONE)               
   CHANNEL( )                          CONNAME( )                 
   CONNOPTS(MQCNO_SHARED_BINDING)       
USERID(userID2)             
   UOWLOG( )                               UOWSTDA(2013-04-04)        
   UOWSTTI(15.26.48)                   UOWLOGDA( )                
   UOWLOGTI( )                             URTYPE(QMGR)               
   EXTURID(XA_FORMATID[00000000] XA_GTRID[] XA_BQUAL[])               
   QMURID(0.6007)                          UOWSTATE(ACTIVE)           
                                                                     

This shows the start date and time of the Unit of Work (UoW). If it were a client connection, the CHANNEL attribute would contain the channel name, and the CONNAME attribute would show the IP address.

No comments:

Post a Comment