Storage classes are an IBM MQ for z/OS administration tool that answers a practical operations question: which disk subsystem should hold messages for this queue? On z/OS, local queue message data lives in page sets—VSAM-based storage managed by the queue manager. A STGCLASS object maps a short name to a page set ID (PSID). Queues reference STGCLASS on their definition so payments traffic can sit on fast volumes while archive traffic uses cheaper storage. Distributed platforms do not use this object type; beginners on Linux should still read this page if their career touches mainframe integration, because partners often mention STGCLASS in runbooks. This tutorial explains DEFINE STGCLASS, PSID, QSGDISP in queue sharing groups, how STGCLASS differs from CF structures for shared queues, change constraints, and capacity planning.
A z/OS queue manager allocates one or more page sets at startup. Each page set has a number (PSID) and capacity on specific volumes. Messages for local queues are written into buffers and eventually into the page set chosen for that queue. Without storage classes, many queues default to the same page set—simple but risky when one application floods the shared pool. Storage classes let you segment by application, department, or recovery tier without renaming hundreds of queues: you ALTER QLOCAL STGCLASS instead of moving data manually.
| Attribute | Role |
|---|---|
| STGCLASS name | 1–8 characters, starts with letter; referenced on QLOCAL |
| PSID | Page set 00–99 receiving message data for this class |
| DESCR | Documentation for operators |
| QSGDISP | In QSG: QMGR, COPY, or GROUP—controls if definition is shared across members |
| CMDSCOPE | Which QSG members run the DEFINE or ALTER command |
DEFINE QLOCAL('PAYMENTS.IN') STGCLASS(PAYFAST) tells the queue manager: new message data for PAYMENTS.IN goes to whatever PSID PAYFAST maps to. Existing messages are not moved automatically when you change STGCLASS—you plan migrations during maintenance. Compare to a filing cabinet label: future mail goes in the new cabinet; old mail stays until drained. DISPLAY QLOCAL STGCLASS shows the current assignment; DISPLAY STGCLASS shows PSID.
Queue sharing groups expose shared queues backed by coupling facility (CF) structures. Those messages never use page set placement via STGCLASS. Local queues on the same queue manager may still use STGCLASS. Mixed estates are normal: shared queues for cross-LPAR workload balancing, local queues for private high-volume buffers. Do not assume STGCLASS tuning fixes shared queue CF fullness—that requires CF structure sizing and SMDS offload covered in the CF structures tutorial.
QSGDISP(GROUP) publishes the storage class definition to all members of the queue sharing group so every LPAR sees the same STGCLASS names. QSGDISP(QMGR) keeps it private to one member—rare for standards you want consistent. COPY supports duplication patterns described in IBM MQ QSG documentation. Beginners administering QSG should coordinate DEFINE STGCLASS with the systems programmer who maintains CFRM and page set definitions in the queue manager startup JCL.
12345678910DEFINE STGCLASS(PAYFAST) PSID(02) + DESCR('Payments local queues - fast page set') DEFINE STGCLASS(ARCHIVE) PSID(08) + DESCR('Low-priority archive queues') DEFINE QLOCAL('PAYMENTS.IN') STGCLASS(PAYFAST) REPLACE DISPLAY STGCLASS(PAYFAST) DISPLAY QLOCAL('PAYMENTS.IN') STGCLASS * Find queues using a class: DISPLAY QLOCAL(*) STGCLASS WHERE(STGCLASS EQ PAYFAST) * Before ALTER STGCLASS PSID: drain queues and verify CURDEPTH 0
IBM MQ blocks destructive changes while queues still hold data or open handles exist. Operations drain queues (or move messages), stop applications, then ALTER STGCLASS PSID or DELETE STGCLASS. Skipping this produces command errors that protect you from splitting message chains across page sets incorrectly. For major PSID moves, some sites define a new STGCLASS, repoint new queues, drain old queues, retire old class—blue/green style.
On Linux queue managers, capacity planning focuses on file system space under /var/mqm, log sizing, and queue MAXDEPTH—not STGCLASS. When reading IBM redbooks that mention storage classes, check the platform footnote. Cross-platform architects map z/OS STGCLASS intent to separate file systems or volumes on distributed hosts even though the object type does not exist there.
The school has several storage closets (page sets). A sticker on the class roster (storage class) says which closet this class puts its craft projects in (messages). Shared hallway cubbies (shared queues) are different furniture—not those closets.
Design STGCLASS names and PSID layout for three applications with different I/O needs.
Why does ALTER STGCLASS fail when CURDEPTH is nonzero? What is the safe procedure?
A team asks to fix shared queue CF usage by changing STGCLASS. Explain why that will not work.
1. DEFINE STGCLASS is primarily used on:
2. Shared queue messages in a QSG are stored in:
3. PSID on a storage class identifies:
4. Before ALTER STGCLASS PSID you must ensure: