API accounting tells you which applications are hammering IBM MQ—not just which queues are full. When ORDERS.IN depth spikes, queue statistics show the backlog; API accounting shows whether PAYMENT_SVC opened ten thousand connections or BATCH_JOB issued a burst of MQPUT calls. Enterprise teams use accounting for chargeback, capacity planning, and security audits proving which service accounts touched production queues overnight. Beginners enable ACCTMQI, never read the accounting queue, and wonder why SYSTEM.ADMIN.ACCOUNTING.QUEUE OFLOW appears during month-end. This tutorial explains enabling MQI accounting on the queue manager, accounting interval and rollover, what fields typically appear in accounting messages, building consumers for Splunk or databases, comparing accounting to STATQ and channel statistics, privacy and retention policy, and operational practices that turn raw accounting into decisions.
| Stream | Granularity | Answers |
|---|---|---|
| API accounting | Application / connection over interval | Who called MQ and how much? |
| Queue statistics | Per queue object | How busy is this queue? |
| Performance events | Threshold crossing | Did depth cross the red line now? |
123456ALTER QMGR ACCTMQI(ENABLED) DISPLAY QMGR ACCTMQI ACCTINT * ACCTINT — accounting interval; verify meaning in 9.3 docs DISPLAY QLOCAL('SYSTEM.ADMIN.ACCOUNTING.QUEUE') CURDEPTH MAXDEPTH * Queue names vary by version — DISPLAY QMGR ACCTMQI help
Attribute names and default accounting queue names differ between MQ 9.x fix packs and z/OS. After ALTER, generate test traffic from one application and confirm accounting messages arrive within one interval. Increase accounting queue MAXDEPTH before high-volume load tests.
Accounting messages are special-format MQ messages, not business payloads. Parsers extract identifiers such as application name, user ID, connection handle class, counts of opens, puts, gets, bytes transferred, and interval start/end timestamps. Exact field layout is in the IBM Application Programming Reference for your version—write parsers against documented structures, not guesswork. Store parsed rows in a time-series database for dashboards: top ten applications by put count per hour, connect storms after deployments, unusual get volume on audit queues.
Map accounting application tags to cost centers. Monthly report: team A drove forty percent of put volume on shared QM_FINANCE. Negotiate sizing funding or require efficiency improvements. Security governance: detect unexpected application names connecting to production—accounting complements security events; events fire on failure, accounting shows success volume from odd names.
z/OS queue managers may integrate accounting with SMF or operations tools. Coordinate with mainframe capacity teams; MQI counts may feed LPAR sizing decisions differently than distributed Kubernetes scale-out. Document which queue sharing group members emit accounting and where consolidated reports land.
Accounting messages may include user IDs and application names revealing business functions. Restrict warehouse access. Apply retention policies matching GDPR or internal standards—purge parsed rows after thirteen months if policy requires. Mask user IDs in non-production exports.
API accounting is the itemized phone bill—queue statistics tell you one number called hotline five thousand times; accounting lists which extensions dialed.
A teacher writes down which kid talked to the marble box most today, not only how many marbles are inside the box.
Design a warehouse schema with five columns for parsed accounting records and explain each.
Incident: queue depth high but accounting shows zero puts from expected app—list three hypotheses.
Compare when you would enable STATQ versus ACCTMQI on a new payment queue manager.
1. API accounting primarily tracks:
2. Queue statistics (STATQ) track:
3. Accounting queues need:
4. Chargeback use case uses accounting to: