MSGQUEUE macro
Use the MSGQUEUE macro to define the characteristics of the three message queue data sets: QBLKS, SHMSG, and LGMSG. The information you specify in this macro is also used in a shared-queues environment. The MSGQUEUE macro is required for all DB/DC and DCCTL systems.
You must include the MSGQUEUE macro statement when the type of definition specified in the IMSCTRL macro statement is ALL, ON-LINE, CTLBLKS, or NUCLEUS.
Dynamic definition
The characteristics of the three message queue data sets cannot be dynamically defined.
Supported environments
The MSGQUEUE macro can be used in the DB/DC, DBCTL, and DCCTL environments.
Syntax
Positional parameters
The MSGQUEUE macro statement does not include positional parameters.
Keyword parameters
To find which parameters apply to your IMS configuration, refer to Selecting the appropriate macros to define your system.
- BUFFERS=
- Specifies the number of buffers to allocate for message queue
management, and the block size to be assigned for all three message
queue data sets. If nbr is
not specified, a default of 255 is used. The minimum nbr specification
is 3; the maximum is 9999. At execution time, the minimum value for
buffers in a shared queues environment is increased to 200. If size3 is
not specified, it is calculated by the following formula:
SIZE3 = ((SIZE1+SIZE2-1)/SIZE1) x ((SIZE1+55)/56) x 56
For the division operations in this formula, only the integer portion of the result is used; the fractional portion of the result is truncated.
This calculation can leave null space at the end of the buffer block for short and long message records.
size1 and size2 should be an even multiple of the QBLKS LRECL of 56.
If the RECLNG defaults of size1 (504) and size2 (2520) are used, then size3 of BUFFERS equals 2520. The maximum specification for size3 is 30632, or the track length of the device on which the data set resides, whichever is smaller. All sizes specified are rounded up to multiples of 4.
RECLNG can be changed before a cold start of IMS, but if a smaller value is specified before a BUILDQ restart, the restart might abend.
You should not allocate less space for a restart of IMS than was allocated for the prior execution. If a smaller logical record length has been allocated, or if less space for the Message Queue data sets has been allocated for restart with BUILDQ, the restart process may terminate abnormally.
- DSETS=
- Specifies the device types on which the three message queue data
sets (IMS.QBLKS, IMS.SHMSG, and IMS.LGMSG,
respectively) are to reside. If all three data sets are to reside
on the same device type, you can specify just the first parameter.
You can specify the following device types: 2305, 3330, 3340, 3350, 3375, 3380, 3390, or LGDK.
When using a 3350, specify the drive format used—3330 or 3350.
LGDK is a generic definition for disk drives that have a track size equal to or greater than 32767 bytes. The 3375, 3380, 3390, and future devices can also be defined as LGDK.
- MRQPSBN=
- Specifies the one- to eight-character alphanumeric name of the IBM® IMS Queue Control Facility for z/OS® (QCF)
program specification block. This parameter allows you to override
the default MRQ PSB name. If not specified, the default name of MRQPSB
is used by the QCF licensed program. The MRQ program can be either
defined in system definition with the APPLCTN macro, or, if DRD is
enabled, defined dynamically with the
CREATE PGM NAME(MRQPSB) SET(BMPTYPE(Y),SCHDTYPE(PARALLEL))
. The default name is MRQPSB. Regardless of whether you use the default name, you must include a PSB for the message region in the stage 1 system definition. If you do not use the default name, you must specify a name for the MRQPSBN block with the MRQPSBN keyword. If an error is made in specifying the MRQPSBN PSB name, a warning message is issued, and the default name is used.Note: The MRQPSBN block is for the exclusive use of MRQ and QCF programs. It cannot be used by other user application programs running as MPPs, BMPs, or IFPs. If an attempt is made to use the PSB block by some other user application program, IMS returns a status code of MR and an AIBRETRN code of 000000F0 on the call. - RECLNG=
- Specifies the logical record lengths for the short and long message
queue data sets, respectively.
The minimum value for size1 is 392. This size includes user data length of 64 bytes plus minimum prefix size of 328. The value specified for size1 must be large enough to accommodate the ISC/LU6.1 (type 84) prefix and the Conversation Extension (type 8D) prefix. If shared queues are used, it must also include an additional X'28' bytes. If size1 is not specified, a default of 504 is assigned.
The minimum value for size2 is 1176. If size2 is not specified, a default of 2520 is assigned. The value specified for size2:
- Must be equal to or greater than size1.
- Cannot exceed the track length of the device on which the data set resides.
- Must be divisible by 4. If it is not, IMS uses the next greater value that is divisible by four as the value of size2.
- Should be even multiples of the QBLKS LRECL of 56.
- Should not exceed the size of the OLDS data set block minus the sum of the block descriptor word length (4 bytes) and prefix item.
If a message does not fit in a large queue record (size2), IMS either spans it to other queue records, or rejects the message with an error.
Choose values for size1 and size2 based on the sizes of the messages processed by the queue manager. When determining which size message queue record to use, the queue manager calculates the size of the message prefix, subtracts that value from the size of the short message queue buffer, and then doubles the remaining value. The queue manager then compares that value to the average user data length for the destination. If the remainder buffer size is greater than or equal to the average user data size, then the short message queue buffer is used. If the remainder buffer size is less than the average user data size, then the large message queue buffer is used. The length of the message prefix varies based on the IMS system options specified.
- SHUTDWN=
- Specifies the number of records to be reserved in each data set
to allow the system to automatically shut down if the data set becomes
filled with unprocessed messages. The maximum valid specification
is 32767. The default is 30. In an XRF system, this parameter also
reserves the number of records in each of the local message queue
data sets (IMS.LGMSGL, IMS.SHMSGL, or IMS.QBLKSL) for shutdown. The number of records specified should provide enough space in each data set to allow for an orderly shutdown, which depends on message throughput and the number of regions that are scheduled. In general, the following calculation applies:
- Maximum number of output messages between synchronization points per application x number of regions scheduled + 1 input message per logical terminal active at the same time.
Usage information
Some messages (such as MFS) from an input terminal can span message queue records. If messages span message queue records, the size of the input segment has no limit. When messages do not span message queue records, the maximum allowable size for input segments is size2 minus the amount for various prefix items included with the data portion of the message queue record.
The maximum size allowed for output segments is size2 minus the amount for various prefix items included with the data portion of the LRECL (message queue record).
Attention: When an output message segment that spans queue records is formatted by MFS, the message might be truncated or formatted incorrectly. To avoid such problems, increase size2 to prevent spanning.
Prefix section | IMS Version 10 and later - size (in bytes) | Comments |
---|---|---|
Basic ¹ | 64 | All messages |
System Segment (81) | 56 | All messages |
64 | All messages with MFS | |
ISC/LU6.1 Prefix (84) ³ | 22 | All ISC/LU6.1 messages |
Extended Prefix (86) ⁴ | 16 | All messages |
APPC (LU6.2) (87) | 128-512 | All APPC messages |
OTMA (87) | 128-4096 | All OTMA messages |
Security Prefix (88) ² | 22 | All messages if RACF® or ETO is defined |
Workload Manager (89) | 24 | All messages |
System Extension (8A) | 24 | All messages |
MSC Extension (8B) | 120 | All messages if MSC is defined |
TMR (8C) | 144 | All messages |
144 | All messages with shared queues | |
Conversation Ext. (8D) ³,⁴ | 40 | All conversational messages |
TM/MSC User Prefix (8E) ⁶ | 5-512 | Dependent on using DFSMSCE0 User Prefix exit routine |
IMS Internal Prefix (8F) ⁷ | 5-512 | Reserved for IMS |
User Data Segments ⁵ | V | All messages |
- All messages begin with a basic prefix segment that has no prefix
code. If the message is a first or only queue buffer message, it has
a basic prefix and some or all the prefixes type 81 through 8D. User
data segments can follow the IMS prefixes.
Prefix segments 81 through 8D begin with a 3-byte LLC field where LL is the 2-byte length of the prefix segment (including the LL field) and C is the 1-byte prefix code.
- The security prefix is included in only the first message buffer if RACF or ETO is used.
- Because they are not system definition values, the ISC/LU6.1 (type 84) prefix and the conversation extension (type 8D) prefix are always included in the maximum length of the IMS prefix calculated at IMS initialization. If shared queues are used, an additional 40 bytes is added.
- All segments following the extended prefix header (type 86) are
extended prefix segments. The IMS release
level determines the size of the extended prefix segments created
for a message. When MSC or shared queues are used, a message can be
processed by an IMS that is of
a different release level than the originating IMS. If the extended prefix segments lengths
are greater for the target IMS, IMS can create or increase the size
of the extended prefix segments. Extended prefix segments are never
shortened.
Recommendation: In an environment where MSC and shared queues are used and IMS systems are of different release levels, use the highest calculated values for size1 and size2 for each IMS.
- User data segments follow the IMS prefix segments.
- You can request that a user prefix be inserted into the message prefix by using the MSC Routing exit routine (DFSMSCE0). The size of the user prefix can be from 5 bytes to 512 bytes long.
- The Workload Router Tool (product number 5697-B87) or another IMS tool can request that an internal prefix be inserted into the message prefix. The size of this user prefix can be between 5 bytes to 512 bytes long.
For messages that span message queue records, the first item (basic) is included in each record of the message. Also, if RACF is generated, the RACF item plus a small (4-byte) system segment is included. All other prefix items, if applicable, appear only in the first record of the message.
The values for size1 and size2 should be tuned for your system.
Related reading: For
information about how to tune the values of size1 and size2 after IMS is operational, refer to Message queue data set allocation in DB/DC and DCCTL environments, and to Initial Optimizing
of IMS Buffer Pools
in IMS Version 15.5 System Administration.
The result of this tuning should yield a value for size1 such that the I/O activity is equally split between the IMS.SHMSG data set, containing input and output message segments up to the length of size1, and the IMS.LGMSG data set, containing all input and output message segments larger than size1.
RECLNG can be changed before a cold start of IMS, but if a smaller value is specified before a BUILDQ restart, the restart may abnormally terminate.
If emergency restart procedures using BUILDQ are to be used, reallocation of logical record and data set spaces must be done carefully. The BUILDQ procedure always restores the message queue entries to the relative position in the respective queue data sets they had at the time they were saved. If the logical record or data set size has been decreased, it may be impossible to perform the restart.
Sample MSGQUEUE macro JCL
MSGQUEUE DSETS=(LGDK),BUFFERS=(40,2520),SHUTDWN=200
This example indicates that the default sizes for the short and long message queue data sets are used. The size of each buffer block is 2520, allowing 1 long message record, 5 short message records or 45 queue block records to fit into a block.
For non-shared queues, 40 buffers are allocated and 200 records in each data set are reserved to allow the system to automatically shut down. For shared queues, the minimum buffer value of 200 is used, and the SHUTDOWN value is ignored.