Programmable Command Format (PCF) is how IBM MQ speaks to automation when humans are not typing runmqsc. Every time MQ Explorer refreshes a channel list, a monitoring agent inventories queues, or a deployment pipeline alters a definition, PCF messages carry the request to the queue manager command server. PCF is not business data on PAYMENT.IN—it is administrative protocol with command codes such as create queue, inquire channel, or change authentication record, plus typed parameters and multi-row responses. Beginners who master only MQSC still benefit from knowing PCF exists: when Explorer shows an attribute your script missed, export or trace often reveals a PCF inquiry you can reproduce in code. This tutorial explains PCF structure at a conceptual level, comparison with MQSC and REST, common command categories, client APIs, error handling, performance for bulk inventory, security, and when to choose PCF versus text scripts in enterprise automation.
Parsing MQSC output with regular expressions breaks when IBM adds attributes or changes column spacing. PCF returns structured fields with identifiers and types—integers, strings, lists—so programs reliably read MAXDEPTH or CHLSTATUS without fragile text parsing. Graphical tools need request-response patterns over many objects; PCF supports multi-object inquiries and continuation where documented. Mainframe operators may live in MQSC; cloud-native platforms prefer APIs—PCF is the long-standing native API before REST wrappers became common.
| Interface | Format | Best for |
|---|---|---|
| runmqsc / MQSC | Text commands | Human ops, Git scripts, quick fixes |
| PCF | Binary PCF messages | Explorer, monitors, Java/.NET admin code |
| REST admin | HTTP JSON | Kubernetes operators, curl, OpenAPI clients |
| z/OS CSQ | Console / CSQUTIL | z/OS operations, RACF-integrated admin |
A PCF command message includes a header describing command type and control flags, followed by parameters. Each parameter has a selector (what field you mean), type, and value. Responses mirror this: completion codes, reason codes, and for inquiries, zero or more rows of attribute parameters. Reason code 0 with compcode 0 means success in MQI terms; non-zero values map to messages documented in IBM reason code references. Programs loop on responses until no more continuation rows for large inquiries.
123456/* Conceptual PCF flow (not executable) */ /* 1. Admin client connects to queue manager */ /* 2. Build PCF message: MQCMD_INQUIRE_Q (example) */ /* 3. Send to command server path */ /* 4. Receive PCF response with Q_NAME, MAXDEPTH, ... parameters */ /* 5. Map parameter selectors to application model */
Exact command codes and supported attributes vary by MQ version; always check the Programmable Command Formats and Programmable Command Formats for Administration publication for your release rather than assuming parity with every MQSC verb.
Java applications use com.ibm.mq.pcf classes with MQQueueManager connected for administration. .NET has IBM.WMQ.PCF or equivalent depending on package. C and COBOL samples exist in IBM installation media. Typical pattern: connect admin client, create PCFMessage, set command, add parameters, execute, parse PCFMessage response. Connection options may use client or bindings mode; admin connections still require authority. Samples in the IBM Knowledge Center demonstrate inquire all queues on a queue manager—study those before writing production inventory jobs.
MQSC is like writing a letter to the command server. PCF is like submitting a government form with numbered boxes—the server reads box 47 as MAXDEPTH without guessing from handwriting.
MQ Explorer does not magic around the command server—it sends PCF inquiries and updates. Monitoring tools (Instana, Datadog integrations, legacy Tivoli) use PCF or REST to poll depth and channel status. When Explorer is slow on queue managers with tens of thousands of objects, the bottleneck is often thousands of PCF inquiries—tune filters and scope. Export definitions features may generate MQSC from repository reads performed via PCF.
PCF responses include completion and reason codes per command and sometimes per object in a batch. Automation must branch: retry on transient errors, alert on authority failures, skip on object not found during delete-idempotent scripts. Log command type and key parameters for audit. Do not swallow reason 2035—not authorized—without identifying the service account needing setmqaut or AUTHREC grant.
Inventory scans every queue on a busy queue manager generate heavy PCF load. Schedule during off-peak or use selective inquire with name patterns. Some sites cache inventory in a database and refresh incrementally. Parallel threads multiply command server load—cap concurrency. Command server degradation affects all admin paths including runmqsc—symptoms correlate.
PCF is powerful: a compromised admin service account can delete channels or clear queues. Use dedicated least-privilege IDs for automation, not personal administrator passwords in cron. TLS on client connections protects PCF on the wire. Separate production and non-production credentials. On z/OS, PCF-style administration flows through the platform command interfaces with RACF checks equivalent to MQSC authority.
IBM MQ REST administration exposes JSON resources for many objects on supported releases. Greenfield Kubernetes operators often choose REST for curl and OpenAPI tooling. PCF remains relevant when using mature Java libraries, Explorer plugins, or tools that predate REST. Mixed estates may use both—document which pipeline uses which interface to avoid double changes.
PCF is the way computer programs ask the queue manager questions and give orders using a strict form, instead of typing sentences like people do in runmqsc.
List three tools at your site that likely use PCF and what they administer.
Run one DISPLAY in runmqsc; note which attributes you would map to PCF parameter selectors.
When would you choose REST over PCF for a new monitoring microservice?
1. PCF is primarily for:
2. MQ Explorer uses:
3. PCF versus MQSC — same:
4. Hand-written PCF is: