PUT

The PUT attribute controls whether applications may add messages to a queue. Production work queues almost always use PUT(ENABLED) so producers can MQPUT. PUT(DISABLED) creates a read-only queue for applications: consumers may still drain with GET(ENABLED), but new application puts are refused at open time. Operations use that pattern during producer migrations, incident isolation, and graceful drain. PUT does not replace security—OAM must still grant put authority—and it does not stop queue manager internal puts from channels on the receiving side. This tutorial explains ENABLED versus DISABLED, interaction with GET and MAXDEPTH, put-only versus get-only queue designs, reason codes, and safe ALTER procedures.

PUT(ENABLED) vs PUT(DISABLED)

PUT attribute values
ValueApplication MQPUTExisting messages
ENABLEDAllowed with authorityCan grow with puts
DISABLEDBlocked for appsCan shrink via gets only

MQOPEN for Put

Applications open with MQOO_OUTPUT or MQOO_INQUIRE as needed. If PUT is DISABLED, put-intent open fails. Syncpoint puts require connection and open success before MQPUT. Batch producers opening once and putting thousands of messages need stable handles—ALTER PUT(DISABLED) mid-run may fail subsequent puts on reopen. Plan changes between batch windows.

shell
1
2
3
4
DEFINE QLOCAL('LEGACY.IN') REPLACE PUT(DISABLED) GET(ENABLED) + DESCR('Drain only - producers migrated to ORDERS.IN') ALTER QLOCAL('ORDERS.IN') PUT(ENABLED) GET(ENABLED) DISPLAY QLOCAL('LEGACY.IN') PUT GET CURDEPTH

Drain-Only Maintenance Pattern

  1. Stop or redirect producers to new queue name.
  2. ALTER old queue PUT(DISABLED) GET(ENABLED).
  3. Let consumers drain CURDEPTH to zero.
  4. Verify no puts via monitoring; delete or archive queue definition.

If producers still run, depth stays flat or grows slowly—find stray jobs before declaring drain complete. Initiation queues and triggers on the old queue should be TRIGGER(DISABLED) to avoid starting consumers that expect new work.

PUT with Remote and Alias Queues

Applications put to QREMOTE or QALIAS names; PUT attribute on the resolved queue matters after resolution. Authority is checked on the name used and target. A QALIAS to a PUT-disabled queue blocks producers using the alias. Remote puts store on XMITQ—the XMITQ must allow the queue manager to place messages (normal internal behavior).

PUT vs Queue Full

PUT(ENABLED) with CURDEPTH at MAXDEPTH returns queue full on MQPUT—not a PUT attribute issue. Fix by consuming, raising MAXDEPTH after capacity review, or shedding load. PUT(DISABLED) fails earlier at open—producers should distinguish in logs for faster triage.

Put-Only and Get-Only Designs

Rare patterns: audit archive fed only by replication may use GET(DISABLED) PUT(ENABLED) for the feeder and opposite on the reader queue. Initiation queues should not receive application PUT. DLQ needs both for handlers that requeue. Document asymmetric GET/PUT clearly in DESCR to prevent operators enabling wrong combination during incidents.

Explain Like I'm Five: PUT

PUT is whether new letters can be dropped into the mailbox. ENABLED means yes (with permission). DISABLED means the slot is sealed for new mail—people can still take mail out if GET allows.

Practice Exercises

Exercise 1

Write MQSC to drain LEGACY.IN while blocking new puts.

Exercise 2

Producer open fails after ALTER. PUT disabled or 2035? How to tell?

Exercise 3

Why does PUT(DISABLED) not stop remote channel delivery to QLOCAL?

Frequently Asked Questions

Frequently Asked Questions

Test Your Knowledge

Test Your Knowledge

1. PUT(DISABLED) means:

  • No new application puts
  • Queue deleted
  • Channel auto-started
  • All gets fail

2. Read-only drain pattern uses:

  • PUT(DISABLED) GET(ENABLED)
  • PUT enabled GET disabled
  • Both disabled forever
  • No MAXDEPTH

3. PUT(ENABLED) still requires:

  • Authority and room under MAXDEPTH
  • Only DESCR
  • TLS off
  • Topic

4. Producer 2053 with PUT enabled suggests:

  • Queue full
  • GET disabled only
  • Invalid DESCR
  • Listener down
Published
Read time13 min
AuthorMainframeMaster
Verified: IBM MQ 9.3 documentation