Storage classes for IBM MQ for z/OS
A storage class is an IBM MQ for z/OS concept that allows the queue manager to map queues to page sets. We can use storage classes to control which data sets are used by which queues.
Introducing storage classes
A storage class maps one or more queues to a page set. This means that messages for that queue are stored on that page set.
Storage classes allow you to control where non-shared message data is stored for administrative, data set space and load management, or application isolation purposes. We can also use storage classes to define the XCF group and member name of an IMS region if we are using the IMS bridge (described in IBM MQ and IMS ).
Shared queues do not use storage classes to obtain a page set mapping because the messages on them are not stored on page sets.
How storage classes work
- You define a storage class, using the DEFINE STGCLASS command, specifying a page set identifier (PSID).
- When you define a queue, you specify the storage class in the STGCLASS attribute.
In the following example, the local queue QE5 is mapped to page set 21 through storage class ARC2.
DEFINE STGCLASS(ARC2) PSID(21) DEFINE QLOCAL(QE5) STGCLASS(ARC2)
This means that messages that are put on the queue QE5 are stored on page set 21 (if they stay on the queue long enough to be written to DASD).
More than one queue can use the same storage class, and we can define as many storage classes as you like. For example, we can extend the previous example to include more storage class and queue definitions, as follows:DEFINE STGCLASS(ARC1) PSID(05) DEFINE STGCLASS(ARC2) PSID(21) DEFINE STGCLASS(MAXI) PSID(05) DEFINE QLOCAL(QE1) STGCLASS(ARC1) ... DEFINE QLOCAL(QE2) STGCLASS(ARC1) ... DEFINE QLOCAL(QE3) STGCLASS(MAXI) ... DEFINE QLOCAL(QE4) STGCLASS(ARC2) ... DEFINE QLOCAL(QE5) STGCLASS(ARC2) ...
In Figure 1, both storage classes ARC1 and MAXI are associated with page set 05. Therefore, the queues QE1, QE2, and QE3 are mapped to page set 05. Similarly, storage class ARC2 associates queues QE4 and QE5 with page set 21.
If you define a queue without specifying a storage class, IBM MQ uses a default storage class.
If a message is put on a queue that names a nonexistent storage class, the application receives an error. We must alter the queue definition to give it an existing storage class name, or create the storage class named by the queue.
We can change a storage class only when:- All queues that use this storage class are empty, and have no uncommitted activity.
- All queues that use this storage class are closed.
Parent topic: Storage management on z/OS