Storage Classes

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.

Page Sets and Why They Exist

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.

STGCLASS attributes beginners need
AttributeRole
STGCLASS name1–8 characters, starts with letter; referenced on QLOCAL
PSIDPage set 00–99 receiving message data for this class
DESCRDocumentation for operators
QSGDISPIn QSG: QMGR, COPY, or GROUP—controls if definition is shared across members
CMDSCOPEWhich QSG members run the DEFINE or ALTER command

Explainer: STGCLASS on the Queue

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.

Shared Queues vs Local Queues

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.

Planning PSID Layout

  • Separate high-churn application page sets from low-churn admin queues.
  • Align page set volumes with storage group performance (SSD vs SATA on modern arrays).
  • Monitor page set utilization with DISPLAY USAGE and SMF; expand before critical threshold.
  • Document which STGCLASS each application team owns for change control.
  • Keep a default STGCLASS for generic queues created without explicit class.

Queue Sharing Group Disposition

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.

Tutorial: MQSC on z/OS

shell
1
2
3
4
5
6
7
8
9
10
DEFINE 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

Alter and Delete Constraints

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.

Distributed MQ: What You Use Instead

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.

Explain Like I'm Five: Storage Classes

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.

Practice Exercises

Exercise 1

Design STGCLASS names and PSID layout for three applications with different I/O needs.

Exercise 2

Why does ALTER STGCLASS fail when CURDEPTH is nonzero? What is the safe procedure?

Exercise 3

A team asks to fix shared queue CF usage by changing STGCLASS. Explain why that will not work.

Frequently Asked Questions

Frequently Asked Questions

Test Your Knowledge

Test Your Knowledge

1. DEFINE STGCLASS is primarily used on:

  • z/OS with page sets
  • Only Docker
  • Only pub/sub topics
  • Only channels

2. Shared queue messages in a QSG are stored in:

  • Coupling facility structures
  • The default PSID only
  • Transmission queues
  • Topic objects

3. PSID on a storage class identifies:

  • Which page set holds messages
  • TCP port
  • LDAP server
  • Channel batch size

4. Before ALTER STGCLASS PSID you must ensure:

  • Queues using it are empty and closed
  • All channels are SSL
  • QMGR is deleted
  • No log exists
Published
Read time14 min
AuthorMainframeMaster
Verified: IBM MQ 9.3 z/OS documentation