IBM Support

How to obtain the value for an attribute from the output of runmqsc in MQ, such as CURDEPTH for a Queue

Question & Answer


Question

You want to issue one single command (which includes MQ runmqsc) that shows the value for an attribute for an object of an MQ queue manager. You would like to use this value in a script and you want to know how to do a simple parsing.
For example, you want to get the number of messages from the CURDEPTH (current depth, that is, the number of messages stored in the queue) attribute for a queue.

[{"Line of Business":{"code":"LOB77","label":"Automation Platform"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SSYHRD","label":"IBM MQ"},"ARM Category":[{"code":"a8m0z00000008ObAAI","label":"Components and Features-\u003EAdministration"}],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All Version(s)","Type":"none"},{"Product":{"code":"SSKM59","label":"IBM MQ for HPE NonStop"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Component":" ","Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"LOB77","label":"Automation Platform"}},{"Product":{"code":"SS5K6E","label":"IBM MQ Appliance"},"Business Unit":{"code":"BU053","label":"Cloud \u0026 Data Platform"},"Component":" ","Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"LOB36","label":"IBM Automation"}}]

Log InLog in to view more of this document

This document has the abstract of a technical article that is available to authorized users once you have logged on. Please use Log in button above to access the full document. After log in, if you do not have the right authorization for this document, there will be instructions on what to do next.

Product Synonym

WebSphere MQ WMQ

Document Information

Modified date:
28 April 2025

UID

swg21395807