PCF Commands

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.

Why PCF Exists

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.

Admin interfaces compared
InterfaceFormatBest for
runmqsc / MQSCText commandsHuman ops, Git scripts, quick fixes
PCFBinary PCF messagesExplorer, monitors, Java/.NET admin code
REST adminHTTP JSONKubernetes operators, curl, OpenAPI clients
z/OS CSQConsole / CSQUTILz/OS operations, RACF-integrated admin

PCF Message Structure (Conceptual)

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.

text
1
2
3
4
5
6
/* 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 */

Common PCF Command Categories

  • Inquire — read object attributes (queues, channels, authinfo, listeners); basis for monitoring dashboards.
  • Create / change / delete — equivalent to DEFINE, ALTER, DELETE in MQSC for supported object types.
  • Channel control — start, stop, reset, ping; operations teams automate recovery playbooks.
  • Security — AUTHREC and related records where PCF is supported on your release.
  • Subscription and pub/sub — display and manage subscriptions in event-driven estates.

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.

Client APIs and Samples

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.

Explainer: Structured Forms Instead of Free Text

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 and Third-Party Tools

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.

Error Handling and Reason Codes

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.

Performance and Bulk Operations

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.

Security

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.

PCF Versus REST for New Projects

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.

Troubleshooting

  1. Verify queue manager running and admin connection succeeds.
  2. Compare same operation in runmqsc—if MQSC works, PCF parameter bug likely.
  3. Check reason code in PCF response against IBM tables.
  4. Confirm command supported on object type and release.
  5. Review command server errors in AMQ log during failure window.

Explain Like I'm Five: PCF Commands

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.

Practice Exercises

Exercise 1

List three tools at your site that likely use PCF and what they administer.

Exercise 2

Run one DISPLAY in runmqsc; note which attributes you would map to PCF parameter selectors.

Exercise 3

When would you choose REST over PCF for a new monitoring microservice?

Frequently Asked Questions

Frequently Asked Questions

Test Your Knowledge

Test Your Knowledge

1. PCF is primarily for:

  • Programmatic administration
  • Application MQPUT
  • TLS handshakes
  • COBOL compile

2. MQ Explorer uses:

  • PCF under the hood
  • Only FTP
  • JES spool
  • No command server

3. PCF versus MQSC — same:

  • Command server destination
  • Application XMITQ
  • DLQ only
  • Topic tree

4. Hand-written PCF is:

  • Uncommon; use APIs
  • Required daily
  • Replaces channels
  • Only on z/OS
Published
Read time21 min
AuthorMainframeMaster
Verified: IBM MQ 9.3 documentation