MQ

 View Only

Morag's Quirks #15: QSGDISP

By Morag Hughson posted Tue March 29, 2022 11:08 PM

  
Morag's
Quirks
This is part of an occasional series of small blog posts where I (Morag) will write about some of the quirks in IBM MQ, in the hope of invoking the response, "Well, I didn't know that!" Read other posts in this series.

When you have a z/OS queue manager which is a member of a Queue Sharing Group (QSG) then the objects on that queue manager, and on it's sibling members in the QSG, have an additional attribute QSGDISP (Queue Sharing Group Disposition) which indicate different ownerships of the objects. Objects can be seen with one of the following four values in their QSGDISP attribute.

QSGDISP Description
QMGR

The object is defined on the page set of just this queue manager.

COPY

The object is defined on the page set of all the queue managers in the Queue Sharing Group, copying its definition from the QSGDISP(GROUP) object of the same name. Messages on this queue are stored on a page set and are only available on the specific queue manager in use.

GROUP

The object definition resides in the shared configuration repository (aka DB2). When the queue is used, the QSGDISP(COPY) object (see above) is used and messages are stored on a page set and are only available on the specific queue manager in use.

SHARED

The object definition resides in the shared configuration repository (aka DB2). When the queue is used, messages are stored in the coupling facility and are available to any queue manager in the queue sharing group.

This value can only be used for local queues and not any other object or queue type.

However, if you look at the documentation for DISPLAY commands, or the set of values in the MQ header file for writing PCF applications, you will see that there are several additional values for the QSGDISP attribute in addition to those shown above. Is my table incomplete? What do these other values mean?

If you use any of the above values in a DISPLAY command, you will only be returned objects with that specific QSGDISP value. These other values are different collections of the above values depending on what you wish to see. The table below illustrates which objects are returned when you use these other values in your DISPLAY command.

QSGDISP(QMGR) QSGDISP(COPY) QSGDISP(GROUP) QSGDISP(SHARED)
QSGDISP(PRIVATE)    
QSGDISP(LIVE)  
QSGDISP(ALL)

QSGDISP(LIVE) is the default value used on DISPLAY commands if you do not specify some other value. QSGDISP(LIVE) shows you the objects you can use, for example queues, that you can actually put messages onto. The QSGDISP(GROUP) objects are omitted from this output as they are just templates which are used to create QSGDISP(COPY) objects and are not usable objects themselves.

QSGDISP(PRIVATE) shows you only the objects that are private to this queue manager and not any shared or group objects. The term "PRIVATE" is often used as the opposite to "SHARED" when talking about IBM MQ Queue Sharing Groups, partly because the phrase "non-shared" could be misinterpreted as meaning "not shareable", i.e. thinking about the SHARE/NOSHARE queue attribute that controls whether multiple applications can open a queue at once. This is of course, quite different from the QSGDISP(SHARED) concept.

You are recommended to regularly dump out all your queue manager object definitions so that if a disaster happens you could use that set of definitions to recreate your objects. When doing so for a queue manager in a Queue Sharing Group, you probably want to save off the QSGDISP(SHARED) queues, the QSGDISP(GROUP) objects and the QSGDISP(QMGR) objects, that is, all the definitional objects, rather than the live objects. There is however, no single command that can give you those three QSGDISP values (see table above).

So if you are using CSQUTIL to make a set of definitions for you, you should follow the example shown in IBM Docs, and have three separate commands to capture all three definitional QSGDISP values.

//QDEFS   EXEC PGM=CSQUTIL,PARM='MQG1'
//STEPLIB  DD   DISP=SHR,DSN=thlqual.SCSQANLE
//         DD   DISP=SHR,DSN=thlqual.SCSQAUTH
//OUTPUT1  DD   DISP=OLD,DSN=MY.COMMANDS(DEFS)
//SYSPRINT DD SYSOUT=*
//SYSIN    DD *
COMMAND DDNAME(CMDINP) MAKEDEF(OUTPUT1)
/*
//CMDINP   DD *
DISPLAY QUEUE(*) ALL QSGDISP(QMGR)
DISPLAY QUEUE(*) ALL QSGDISP(GROUP)
DISPLAY QUEUE(*) ALL QSGDISP(SHARED)
/*

If you use MO71 rather than CSQUTIL to export your queue manager object definitions, then you will be pleased to learn that you can do the same thing with that tool too. Read this post for more details.


Morag Hughson is an MQ expert. She spent 18 years in the MQ Devt organisation before taking on her current job writing MQ Technical education courses with MQGem. She also blogs for MQGem. You can connect with her here on IMWUC or on Twitter and LinkedIn.

#mquirks
#IBMMQ
#IBMChampion
0 comments
59 views

Permalink