Made byBobr AI

IBM MQ on z/OS: Architecture, Copybooks & CICS Integration

Technical deep-dive into IBM MQ for z/OS. Learn about MSTR/CHINIT address spaces, COBOL copybooks (MQMD, MQPMO), CICS adapters, and Sysplex Queue Sharing Groups.

#ibm-mq#zos#mainframe#cobol#cics#enterprise-messaging#sysplex#middleware
Watch
Pitch

IBM MQ on z/OS

Architecture · Copybooks · CICS & Batch Integration

A comprehensive technical deep-dive into IBM MQ for z/OS — covering queue manager architecture, address spaces, MQI programming with COBOL copybooks, CICS adapter integration, and batch processing patterns.

z/OS LPAR
CICS
BATCH JOB
MSTR
QUEUE MANAGER
CHINIT
CHANNEL INITIATOR
IBM MQ for z/OS · Enterprise Messaging Architecture
Made byBobr AI

Agenda

01

z/OS Subsystem Overview

How MQ runs as a z/OS subsystem

02

Queue Manager Architecture

MSTR & CHINIT address spaces

03

Channel Initiator Deep Dive

MCAs, listeners, TLS tasks

04

Queue Sharing Groups

Sysplex & coupling facility

05

MQI Copybooks Explained

CMQC, CMQMD, CMQPMO, CMQGMO

06

CICS Integration

Adapter, bridge, CKTI trigger monitor

07

Batch Processing Patterns

JCL, COBOL MQPUT/MQGET

08

Security & Best Practices

RACF, CHLAUTH, TLS on z/OS

IBM MQ for z/OS · Enterprise Messaging Architecture
Made byBobr AI
01

z/OS Subsystem Overview

MQ runs as a named z/OS SUBSYSTEM — started at IPL via the subsystem name table

Each Queue Manager has a unique 4-character name (e.g. CSQ1) — this name is used for all MQSC commands and dump analysis

Queue managers are started via JCL procedures or operator START commands

MQ libraries include: SCSQLOAD (load modules), SCSQAUTH (authorization), SCSQCOB (COBOL copybooks), SCSQPROC (sample JCL)

Data persistence uses PAGE SETS (VSAM datasets) or Db2 tables for object/message storage

LOGS — active and archive — are critical for restart and recovery after failures

z/OS LPAR
Subsystem Name Table
Queue Manager (CSQ1)
MSTR
ADDRESS SPACE
CHINIT
ADDRESS SPACE
Page Sets
(VSAM)
MQ Logs
(Active/Archive)
TCP/IP
IBM MQ for z/OS · Subsystem Overview
Made byBobr AI
02

Queue Manager Architecture

Single CHINIT per Queue Manager — runs in same z/OS image

MSTR owns all MQ objects; CHINIT executes channel instances

64-bit MEMLIMIT: IBM recommends minimum 3GB for queue managers

z/OS LPAR
MSTR Address Space
  • Core control blocks & transactional integrity
  • Logging & recovery functions
  • MQ object ownership (queues, channels, topics)
  • API processing for application MQI calls
  • Command processing (MQSC)
  • Startup, init parameters & termination logic
  • Storage: 24-bit, 31-bit, 64-bit areas
CHINIT Address Space
  • Message Channel Agents (MCAs)
  • Inbound/outbound channel management
  • TCP/IP interface layer
  • TLS encryption/decryption tasks
  • Listener processes (inbound connections)
  • Channel supervisor process
PAGE SETS
(VSAM)
TRANSACTION
LOGS
CICS
MQI calls
IMS
BATCH
IBM MQ for z/OS · Enterprise Messaging Architecture
Made byBobr AI
03

Channel Initiator (CHINIT)

CHINIT Address Space

SUPERVISOR

Manages CHINIT lifecycle, restarts failed channels, coordinates channel events

LISTENER

Listens on TCP/IP port (default 1414) for inbound channel connection requests

NAME SERVER

Resolves TCP hostnames to IP addresses for channel endpoints

MCA — Sender

Reads msgs from Transmission Queue → sends over network

MCA — Receiver

Receives msgs from network → puts to local destination queue

TLS TASKS

Handles certificate validation, encryption/decryption, CRL checks — offloads crypto from MCAs

Transmission Queue Queue Manager
TCP/IP Network
Remote Queue Manager CHINIT
💡
Thousands of concurrent MCA processes (channels) can run in a single CHINIT
🔐
TLS key size directly impacts channel start rate — very high strength ≈ 2× slower than high strength
📊
31-bit storage (ECSA) is the primary scaling constraint — ~5KB per logical connection
IBM MQ for z/OS · Deep Dive
Made byBobr AI
04

Queue Sharing Groups & Sysplex

PARALLEL SYSPLEX
LPAR 1
CICS
BATCH
QUEUE MANAGER CSQ1
MSTR
ADDRESS SPACE
CHINIT
CHANNEL INITIATOR
Shared Queues
CF
Structure
LPAR 2
CICS
QUEUE MANAGER CSQ2
MSTR
ADDRESS SPACE
CHINIT
CHANNEL INITIATOR
XCF Cross-System Coupling
High Availability
If CSQ1 fails, CSQ2 continues serving shared queues flawlessly.
Workload Balancing
Client connections distributed smoothly across multiple QMs.
Shared Queue Access
Messages in CF are accessible from any queue manager in the QSG.
CHINIT per QM
Each queue manager retains its own channel initiator address space.
IBM MQ for z/OS · Enterprise Messaging Architecture
Made byBobr AI
05

MQI Copybooks — COBOL Definitions

CMQC

Purpose: Main MQI constants, option flags & reason codes
  • MQOO_INPUT_SHARED, MQOO_OUTPUT — open options
  • MQPMO_SYNCPOINT, MQPMO_NO_SYNCPOINT
  • MQGMO_WAIT, MQGMO_NO_WAIT, MQGMO_CONVERT
  • MQCC_OK, MQRC_NONE, MQRC_NO_MSG_AVAILABLE
Used in: ALL MQ COBOL programs

CMQMD / CMQMDV

Purpose: Message Descriptor — metadata for every message
  • MsgId — unique message identifier (24 bytes)
  • CorrelId — correlation identifier for request/reply
  • Format — MQFMT_STRING, MQFMT_NONE, MQFMT_PCF
  • Persistence — MQPER_PERSISTENT / NON_PERSISTENT
  • Priority, Expiry, CodedCharSetId, Encoding
  • PutDate, PutTime — timestamp of message put
Note: Use CMQMDV (versioned) — ensures new fields available

CMQPMO / CMQPMOV

Purpose: Put Message Options — controls MQPUT behavior
  • MQPMO_SYNCPOINT — puts within unit of work
  • MQPMO_NO_SYNCPOINT — immediate, no UoW
  • MQPMO_FAIL_IF_QUIESCING — fail if QM shutting down
  • MQPMO_LOGICAL_ORDER — message grouping order
  • Context options — for security propagation

CMQGMO / CMQGMOV

Purpose: Get Message Options — controls MQGET behavior
  • MQGMO_WAIT + WaitInterval — blocking get with timeout
  • MQGMO_SYNCPOINT — get within unit of work (recommended)
  • MQGMO_CONVERT — auto CCSID/encoding conversion
  • MQGMO_BROWSE_FIRST / BROWSE_NEXT — non-destructive browse
  • MQGMO_LOCK / UNLOCK — temporary message locking

CMQCFC

Purpose: PCF (Programmable Command Format) constants
  • MQCMD_INQUIRE_Q, MQCMD_CHANGE_Q_MGR — admin commands
  • Sent to SYSTEM.ADMIN.COMMAND.QUEUE via MQPUT
  • Responses read via MQGET on reply queue
  • Used for: in-band administration & monitoring
Application (MQPUT)
SYSTEM.ADMIN.COMMAND.QUEUE
Reply Queue (MQGET)
IBM MQ for z/OS · Enterprise Messaging Architecture
Made byBobr AI
05b

COBOL MQI Program Structure

COBOL Working Storage
       WORKING-STORAGE SECTION.
      *-- MQ Handles
       01 HCONN          PIC S9(9) BINARY.
       01 HOBJ           PIC S9(9) BINARY.
       01 COMPCODE       PIC S9(9) BINARY.
       01 REASON         PIC S9(9) BINARY.
      *-- MQ Structures (from copybooks)
       01 MQMD.          COPY CMQMDV.
       01 MQPMO.         COPY CMQPMOV.
       01 MQGMO.         COPY CMQGMOV.
       01 MQOD.          COPY CMQODV.
      *-- MQ Constants
                         COPY CMQC.
      *-- Message buffer
       01 MSG-BUFFER     PIC X(4096).
       01 MSG-LENGTH     PIC S9(9) BINARY.
       01 BUFF-LENGTH    PIC S9(9) BINARY
                         VALUE 4096.
PROCEDURE DIVISION — MQI Calls
      * Connect to Queue Manager
       CALL 'MQCONN' USING
           WS-QMGR-NAME HCONN
           COMPCODE REASON.
      * Open Queue for Output
       CALL 'MQOPEN' USING
           HCONN MQOD MQOO-OUTPUT
           HOBJ COMPCODE REASON.
      * Put a Message
       CALL 'MQPUT' USING
           HCONN HOBJ MQMD MQPMO
           BUFF-LENGTH MSG-BUFFER
           COMPCODE REASON.
      * Commit Unit of Work
       CALL 'MQCMIT' USING
           HCONN COMPCODE REASON.
      * Disconnect
       CALL 'MQDISC' USING
           HCONN COMPCODE REASON.

MQI Call Sequence

MQCONN
Connect to Queue Manager
MQOPEN
Open object (Queue/Topic)
MQPUT / MQGET
Send or retrieve messages
MQCMIT / MQBACK
Commit / Backout unit of work
MQCLOSE
Close object
MQDISC
Disconnect from Manager
  • CSQCSTUB — The MQ stub library. Link-edit into your COBOL program to resolve MQI calls at runtime (z/OS batch). In CICS, use CSQCSTUB via DFHRPL.
  • MQMD_DEFAULT — Always initialize MQMD using defaults from CMQMDV before setting your own fields. Prevents version mismatch.
  • Syncpoint Tip — Use MQPMO_SYNCPOINT on MQPUT and MQGMO_SYNCPOINT on MQGET + MQCMIT for transactional integrity. Messages backout on failure.
  • STEPLIB — Include hlq.SCSQLOAD in STEPLIB for batch jobs. Use SCSQCOB for copybooks during the COBOL compile step.
IBM MQ for z/OS · Enterprise Messaging Architecture
Made byBobr AI
06

CICS Integration — The MQ Adapter

CICS Address Space
COBOL Application Program
CALL 'MQPUT'/'MQGET' via CSQCSTUB
RMI (Resource Manager Interface)
DFHMQTRU
CICS Task-Related User Exit (TRUE)
MQI Connection
MQ Queue Manager (MSTR)
RACF
Queue Manager Core
Local
Queues
CHINIT
TCP/IP →
Remote QM

CICS-MQ Adapter

  • Manages CICS↔Queue Manager connection
  • Application programs call native MQI verbs: MQCONN, MQOPEN, MQPUT, MQGET, MQCLOSE, MQDISC
  • Uses CSQCSTUB stub library (linked into program)
  • DFHMQTRU exits runs on L8/X8/T8 open TCBs (threadsafe — avoids TCB switching overhead)
  • Configure via MQCONN CICS resource definition
  • Add SCSQLOAD + SCSQAUTH to CICS DFHRPL

CICS-MQ Bridge (MQCIH)

  • Allows MQ messages to DRIVE legacy CICS transactions
  • MQ-UNAWARE programs — no MQI calls needed in CICS program
  • Message carries MQMD + MQCIH header structure
  • MQCIH fields: TransactionId, UOWControl, Function, ReplyToQ
  • Supports DPL programs (EXEC CICS LINK) and 3270 transactions
  • Perfect for fronting legacy 3270 apps with modern channels

CKTI Trigger Monitor

  • CKTI is the CICS-MQ trigger monitor transaction
  • Issues MQGET with WAIT on an initiation queue
  • When queue triggers → MQ puts trigger message → CKTI starts user transaction
  • Configure with MQMONITOR CICS resource
  • CKAM (Alert Monitor) throttles MQGET rate based on WLM health
  • Multiple CKTI instances for throughput & redundancy
IBM MQ for z/OS · Enterprise Messaging Architecture
CICS & MQ INTEGRATION ARCHITECTURE
Made byBobr AI
06b

CICS-MQ Message Flow Patterns

Inbound Request Pattern (CKTI-triggered)

External
App / Ch
MQ Trans
Queue
CHINIT
MCA
Local
Request Q
CKTI
Trigger
CICS Trans
Started
MQGET
Message
Business
Processing
MQPUT
Reply
Reply
Queue
Requester

Trigger fires when message arrives. CKTI starts CICS transaction. Transaction MQGETs and processes. MQCMIT to confirm.

Outbound Request Pattern (CICS → MQ → Batch)

User / 3270
Terminal
CICS COBOL
Program
MQPUT to
Request Q
MQCMIT
MQ Queue
Manager
Trans
Queue
Batch Job
MQGET
Process &
DB2 Upd
MQPUT
Reply
CICS MQGET
Reply
Response
to User

Async decoupling. CICS puts and commits immediately. Batch picks up asynchronously. Correlation via MQMD.CorrelId.

MQCIH Structure

(Used for CICS Bridge pattern)

StrucId = 'CIH '
Version = MQCIH_VERSION_2
Format = MQFMT_CICS
Function = MQCIH_PASS_THROUGH
TransactionId = 'TRAN'
UOWControl = MQCIH_UOW_COMMIT
ReplyToQ = 'REPLY.QUEUE'
IBM MQ for z/OS · Enterprise Messaging Architecture
Made byBobr AI
07

Batch MQ Processing on z/OS

JCL Setup for Batch MQ Programs

Batch JCL — STEPLIB Requirements

//MQBATCH  JOB (ACCT),'MQ BATCH',CLASS=A,
//         MSGCLASS=X,NOTIFY=&SYSUID
//*
//STEP1    EXEC PGM=YOURMQPGM,
//         REGION=0M
//*
//STEPLIB  DD DSN=MQ.SCSQLOAD,DISP=SHR
//         DD DSN=YOUR.LOADLIB,DISP=SHR
//*
//SYSOUT   DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//*
//  Compile Step (Separate Job):
//COMPILE  EXEC PGM=IGYCRCTL
//SYSLIB   DD DSN=MQ.SCSQCOB,DISP=SHR
//         DD DSN=SYS1.MACLIB,DISP=SHR

Link-Edit — Include CSQCSTUB

//LKED     EXEC PGM=IEWL
//SYSLIB   DD DSN=MQ.SCSQLOAD,DISP=SHR
//SYSIN    DD *
  INCLUDE SYSLIB(CSQCSTUB)
  NAME YOURMQPGM(R)
/*

Batch Processing Patterns

MQPUT (Fire and Forget)

Batch job puts messages to queue and commits. Consumer (another batch or CICS) processes asynchronously. Use MQPMO_SYNCPOINT + MQCMIT.

MQGET with WAIT

Batch job loops: MQGET with MQGMO_WAIT (WaitInterval). Processes each message. MQCMIT after each. Continues until MQRC_NO_MSG_AVAILABLE.

Request/Reply Pattern

Put message to request queue with MQMD.ReplyToQ set. MQGET on reply queue matching CorrelId = MsgId. Timeout via WaitInterval.

RRS Coordination (z/OS)

Enlist MQ in z/OS Resource Recovery Services. Allows coordinated commits across MQ + Db2 in a single atomic transaction. No separate MQCMIT needed.

UNIT OF WORK BEST PRACTICES

Always use MQGMO_SYNCPOINT on MQGET for critical messages. On abend/disconnect, QM automatically backs out uncommitted gets — no message loss. Commit frequency = balance between throughput and recovery time.

IBM MQ for z/OS · Batch Processing
Made byBobr AI

Key Copybook Structure Field Reference

07b

MQMD — Message Descriptor

Field Name
Purpose / Values
MsgId
Unique 24-byte message ID (auto-set by QM)
CorrelId
24-byte correlation ID (request/reply matching)
MsgType
MQMT_REQUEST, MQMT_REPLY, MQMT_DATAGRAM
Format
MQFMT_STRING, MQFMT_NONE, MQFMT_PCF
Persistence
MQPER_PERSISTENT (survives restart) / NON_PERSISTENT
Priority
0 (low) to 9 (high), default 0
Expiry
Message TTL in tenths of a second (-1 = unlimited)
CodedCharSetId
CCSID (e.g., 37 = EBCDIC US, 1208 = UTF-8)
Encoding
Numeric encoding (MQENC_NATIVE on z/OS)
ReplyToQ
Queue name for reply messages
ReplyToQMgr
QM name for reply
PutDate
Set by QM on MQPUT (YYYYMMDD)
PutTime
Set by QM on MQPUT (HHMMSSTH)
Version
MQMD_VERSION_1 / VERSION_2

MQPMO — Put Message Options

Field Name
Purpose / Values
Options
Bit flags combined with OR:
MQPMO_SYNCPOINT
Put within unit of work → MQCMIT to confirm
MQPMO_NO_SYNCPOINT
Immediate put, no UoW
MQPMO_FAIL_IF_QUIESCING
Return error if QM quiescing (recommended)
MQPMO_SET_IDENTITY_CONTEXT
Set identity fields from MQMD
MQPMO_NEW_MSG_ID
Generate new MsgId on each put
MQPMO_LOGICAL_ORDER
Maintain order within message group
ResolvedQName
Actual queue name after alias resolution (output)
ResolvedQMgrName
Actual QM name (output field)
NewMsgHandle
Handle for message properties (V7+)

MQGMO — Get Message Options

Field Name
Purpose / Values
Options
Bit flags:
MQGMO_WAIT
Block until message arrives or timeout
MQGMO_NO_WAIT
Return immediately,
MQRC_NO_MSG_AVAILABLE if empty
MQGMO_SYNCPOINT
Get within unit of work (RECOMMENDED)
MQGMO_CONVERT
Auto-convert CCSID/Encoding on get
MQGMO_BROWSE_FIRST
Start browse (non-destructive)
MQGMO_BROWSE_NEXT
Continue browse sequence
MQGMO_LOCK
Lock browsed message (hide from others)
MQGMO_UNLOCK
Release lock without removing message
MQGMO_ACCEPT_TRUNCATED_MSG
Accept message even if buffer too small
WaitInterval
Milliseconds to wait (-1 = forever)
MatchOptions
MQMO_MATCH_MSG_ID, MQMO_MATCH_CORREL_ID
IBM MQ for z/OS · Field Reference Guide
Made byBobr AI
08

Security on IBM MQ for z/OS

z/OS LPAR
RACF
MSTR
QUEUE MANAGER
CHINIT
CHANNEL INITIATOR
TLS
CHLAUTH
Ext. Client / Channel
CICS Region
Batch Job
RACF User ID check
Object Authority
TLS Encrypted

RACF Integration

Queue manager runs under a dedicated RACF User ID
MQ uses RACF to control access to: Queues, QMGRs, Processes, Namelists, Topics
RACF resource classes: MQQUEUE, MQCMDS, MQADMIN
Each CICS region and batch job connects under its own RACF ID
In multilevel-secure environments: separate QMs per security classification

CHLAUTH Rules

Channel Authentication Records control which connections are allowed
Blocks all channel connections by default — explicit rules required
Match on: channel name, client IP address, SSLPEER (TLS certificate DN)
Actions: ALLOW, BLOCK, or MAP to a specific MCAUSER
Replaces deprecated SSLPEER and MCAxxx channel attributes
SET CHLAUTH command managed seamlessly via MQSC

TLS on z/OS Channels

TLS configured per channel via SSLCIPH attribute
z/OS uses SAF Keyring (RACF) to store certificates — no file-based keystores
SSLKEYR = 'user/keyring-name' defined in CHINIT startup parameters
Modern TLS 1.2 / TLS 1.3 natively supported (MQ 9.2+)
CRL checking achieved via optimized OCSP or LDAP lookups
Key strength impacts performance: Very High Strength ≈ 2× slower channel start

CONNAUTH — App Authentication

CONNAUTH defines how applications explicitly authenticate to the queue manager
Can strictly require USERID + PASSWORD on MQCONN/MQCONNX call
Maps directly to RACF user validation (MQCSP structure in MQCONNX)
Prevents any anonymous fallback connections from generic batch or CICS apps
ADOPTMCA attribute on channels allows for dynamic MCA identity adoption
Enforced audit trail: all authentication events logged safely via SMF 115
z/OS Messaging Security · Enterprise Architecture
Made byBobr AI
08b

Storage & Performance Tuning

1
5 KB
ECSA per concurrent logical connection. Formula: Max Connections × 5KB = ECSA requirement
2
3 GB+
Minimum MEMLIMIT recommended for queue manager 64-bit storage. Formula: 2GB + Total Buffer Pool sizes
3
5,522
Maximum SVRCONN channels in MQ 9.4 CHINIT test before hitting 80% of 31-bit storage limit
Storage Types on z/OS
24-bit Storage
SQA/CSA — legacy, very limited, avoid if possible
31-bit Storage
ECSA — ~5KB/connection. Primary scaling constraint for CHINIT channels
64-bit Storage
MEMLIMIT — buffer pools, structure backups. Set MEMLIMIT=3G minimum
Page Sets
VSAM datasets — store MQ objects and message data. Num 0 to 100
Logs
Active & Archive logs — set Log Buffer Size for high throughput
Buffer Pool Tuning
  • Buffer pools (BUFFPOOL command) control how much memory is used to cache page set I/O
  • LOCATION(ABOVE) = place buffer pool in 64-bit storage (recommended)
  • Larger buffer pools → fewer page set I/Os → better throughput
  • Each page set is assigned to exactly one buffer pool
  • Monitor with DISPLAY BUFFPOOL command and SMF 115
Performance Tuning Recommendations
1
Set MEMLIMIT explicitly — never use NOLIMIT. Calculate: 2GB + buffer pool sizes + 500MB for RECOVER CFSTRUCT
2
Use LOCATION(ABOVE) for all buffer pools to avoid 31-bit storage pressure
3
Limit SVRCONN channels — monitor 31-bit storage with SMF 115 Class 3 trace (ACELIM)
4
Log buffer sizing — large log buffers reduce I/O. Use DSNAOINI parameters for log performance
5
TLS tradeoffs — Balance security strength vs. channel start rate. Very High Strength ≈ 50% of High Strength throughput
IBM MQ for z/OS · Storage & Performance Tuning
Made byBobr AI
09

End-to-End z/OS MQ Architecture

Parallel Sysplex
APPLICATION LAYER
CICS Region
COBOL App
CSQCSTUB
DFHMQTRU
MQI
MQCONN resource / CKTI trigger
Batch Job (JCL)
COBOL
MQCONN/PUT/GET
CSQCSTUB
STEPLIB: SCSQLOAD
IMS Region
IMS-MQ bridge / MQI calls
QUEUE MANAGER
(MSTR)
MQ Objects
Queues, Channels, Topics, Namelists
Page Sets
(0-100)
Active & Archive
Logs
🔒
RACF Security Checks
Command Server
SYSTEM.ADMIN.COMMAND.QUEUE
Dead Letter Queue
SYSTEM.DEAD.LETTER.QUEUE
CHANNEL INIT.
(CHINIT)
Supervisor & Listener
(port 1414)
Sender MCAs
→ Transmission Queues
Receiver MCAs
← Inbound channels
TLS Tasks
(z/OS Keyring)
Name Server
Coupling Facility
Shared Queue Structures
NETWORK LAYER
🌐
TCP/IP
Remote Queue Manager
Distributed systems
MQ Client Applications
REST API / mqweb
HTTP/HTTPS
MQ Component
z/OS System Component
Optional / HA Component
IBM MQ for z/OS · Enterprise Messaging Architecture
Made byBobr AI
10
10

Key Takeaways & Best Practices

01

Two Address Spaces, One Queue Manager

MSTR owns MQ objects and API processing. CHINIT runs MCAs and handles all network I/O. They must always run together.

02

Always Use Versioned Copybooks

Use CMQMDV, CMQPMOV, CMQGMOV — not CMQMD/CMQPMO/CMQGMO. Versioned copybooks ensure new fields are accessible and Version is set correctly.

03

SYNCPOINT is Non-Negotiable for Critical Data

Always use MQPMO_SYNCPOINT + MQGMO_SYNCPOINT + MQCMIT for business-critical messages. On abend/disconnect, QM automatically backs out.

04

CSQCSTUB is Your Link to MQ in Batch & CICS

Link CSQCSTUB into COBOL programs for z/OS batch. Include SCSQLOAD in STEPLIB. In CICS, include in DFHRPL.

05

CHLAUTH — Default Deny, Explicit Allow

All MQ channels blocked by default. Define explicit CHLAUTH rules for each application. Map to specific MCAUSER RACF IDs.

06

ECSA: 5KB per Connection — Plan Ahead

Each logical connection costs ~5KB of ECSA. Max connections × 5KB = your ECSA requirement. Monitor with SMF 115 statistics.

07

MEMLIMIT Must Be Explicit

Never use NOLIMIT. Set MEMLIMIT = 2GB + buffer pool sizes, minimum 3GB. Add 500MB if using RECOVER CFSTRUCT.

08

CKTI Triggers Async CICS Processing

Use MQMONITOR + CKTI for event-driven CICS. MQ triggers start CICS transactions when messages arrive. CKAM throttles under WLM pressure.

09

TLS Keyring — Not Files — on z/OS

Use SAF Keyrings (RACF) for TLS certificates. No file-based keystores. SSLKEYR='user/keyring'. TLS 1.3 supported in MQ 9.2+.

10

Queue Sharing Groups for HA

QSGs with Coupling Facility provide active/active HA across LPARs. If one QM fails, others access shared queues. Each QM retains its own CHINIT.

IBM MQ for z/OS — Built for enterprise reliability, security and performance at scale
IBM MQ for z/OS · Enterprise Messaging Architecture
Made byBobr AI
Bobr AI

DESIGNER-MADE
PRESENTATION,
GENERATED FROM
YOUR PROMPT

Create your own professional slide deck with real images, data charts, and unique design in under a minute.

Generate For Free

IBM MQ on z/OS: Architecture, Copybooks & CICS Integration

Technical deep-dive into IBM MQ for z/OS. Learn about MSTR/CHINIT address spaces, COBOL copybooks (MQMD, MQPMO), CICS adapters, and Sysplex Queue Sharing Groups.

IBM MQ on z/OS

Architecture · Copybooks · CICS & Batch Integration

A comprehensive technical deep-dive into IBM MQ for z/OS — covering queue manager architecture, address spaces, MQI programming with COBOL copybooks, CICS adapter integration, and batch processing patterns.

IBM MQ for z/OS · Enterprise Messaging Architecture

z/OS Subsystem Overview

How MQ runs as a z/OS subsystem

Queue Manager Architecture

MSTR & CHINIT address spaces

Channel Initiator Deep Dive

MCAs, listeners, TLS tasks

Queue Sharing Groups

Sysplex & coupling facility

MQI Copybooks Explained

CMQC, CMQMD, CMQPMO, CMQGMO

CICS Integration

Adapter, bridge, CKTI trigger monitor

Batch Processing Patterns

JCL, COBOL MQPUT/MQGET

Security & Best Practices

RACF, CHLAUTH, TLS on z/OS

IBM MQ for z/OS · Enterprise Messaging Architecture

01

z/OS Subsystem Overview

MQ runs as a named z/OS SUBSYSTEM

— started at IPL via the subsystem name table

Each Queue Manager has a unique 4-character name (e.g. CSQ1)

— this name is used for all MQSC commands and dump analysis

Queue managers are started

via JCL procedures or operator START commands

MQ libraries include:

SCSQLOAD (load modules), SCSQAUTH (authorization), SCSQCOB (COBOL copybooks), SCSQPROC (sample JCL)

Data persistence uses PAGE SETS (VSAM datasets)

or Db2 tables for object/message storage

LOGS — active and archive —

are critical for restart and recovery after failures

IBM MQ for z/OS · Subsystem Overview

02

Queue Manager Architecture

Single CHINIT per Queue Manager — runs in same z/OS image

MSTR owns all MQ objects; CHINIT executes channel instances

64-bit MEMLIMIT: IBM recommends minimum 3GB for queue managers

Core control blocks & transactional integrity

Logging & recovery functions

MQ object ownership (queues, channels, topics)

API processing for application MQI calls

Command processing (MQSC)

Startup, init parameters & termination logic

Storage: 24-bit, 31-bit, 64-bit areas

Message Channel Agents (MCAs)

Inbound/outbound channel management

TCP/IP interface layer

TLS encryption/decryption tasks

Listener processes (inbound connections)

Channel supervisor process

IBM MQ for z/OS · Enterprise Messaging Architecture

Channel Initiator (CHINIT)

CHINIT Address Space

SUPERVISOR

Manages CHINIT lifecycle, restarts failed channels, coordinates channel events

LISTENER

Listens on TCP/IP port (default 1414) for inbound channel connection requests

NAME SERVER

Resolves TCP hostnames to IP addresses for channel endpoints

MCA — Sender

Reads msgs from Transmission Queue → sends over network

MCA — Receiver

Receives msgs from network → puts to local destination queue

TLS TASKS

Handles certificate validation, encryption/decryption, CRL checks — offloads crypto from MCAs

Transmission Queue

Queue Manager

TCP/IP Network

Remote Queue Manager CHINIT

Thousands of concurrent MCA processes (channels) can run in a single CHINIT

TLS key size directly impacts channel start rate — very high strength ≈ 2× slower than high strength

31-bit storage (ECSA) is the primary scaling constraint — ~5KB per logical connection

IBM MQ for z/OS · Deep Dive

04

Queue Sharing Groups & Sysplex

LPAR 1

LPAR 2

QUEUE MANAGER CSQ1

QUEUE MANAGER CSQ2

XCF Cross-System Coupling

High Availability

If CSQ1 fails, CSQ2 continues serving shared queues flawlessly.

Workload Balancing

Client connections distributed smoothly across multiple QMs.

Shared Queue Access

Messages in CF are accessible from any queue manager in the QSG.

CHINIT per QM

Each queue manager retains its own channel initiator address space.

IBM MQ for z/OS · Enterprise Messaging Architecture

MQI Copybooks — COBOL Definitions

05

CMQC

Main MQI constants, option flags & reason codes

MQOO_INPUT_SHARED, MQOO_OUTPUT

— open options

MQPMO_SYNCPOINT, MQPMO_NO_SYNCPOINT

MQGMO_WAIT, MQGMO_NO_WAIT, MQGMO_CONVERT

MQCC_OK, MQRC_NONE, MQRC_NO_MSG_AVAILABLE

Used in: ALL MQ COBOL programs

CMQMD / CMQMDV

Message Descriptor — metadata for every message

MsgId

— unique message identifier (24 bytes)

CorrelId

— correlation identifier for request/reply

Format

— MQFMT_STRING, MQFMT_NONE, MQFMT_PCF

Persistence

— MQPER_PERSISTENT / NON_PERSISTENT

Priority, Expiry, CodedCharSetId, Encoding

PutDate, PutTime

— timestamp of message put

Use CMQMDV (versioned) — ensures new fields available

CMQPMO / CMQPMOV

Put Message Options — controls MQPUT behavior

MQPMO_SYNCPOINT

— puts within unit of work

MQPMO_NO_SYNCPOINT

— immediate, no UoW

MQPMO_FAIL_IF_QUIESCING

— fail if QM shutting down

MQPMO_LOGICAL_ORDER

— message grouping order

Context options

— for security propagation

CMQGMO / CMQGMOV

Get Message Options — controls MQGET behavior

MQGMO_WAIT + WaitInterval

— blocking get with timeout

MQGMO_SYNCPOINT

— get within unit of work (recommended)

MQGMO_CONVERT

— auto CCSID/encoding conversion

MQGMO_BROWSE_FIRST / BROWSE_NEXT

— non-destructive browse

MQGMO_LOCK / UNLOCK

— temporary message locking

CMQCFC

PCF (Programmable Command Format) constants

MQCMD_INQUIRE_Q, MQCMD_CHANGE_Q_MGR

— admin commands

Sent to SYSTEM.ADMIN.COMMAND.QUEUE

via MQPUT

Responses read via MQGET

on reply queue

Used for:

in-band administration & monitoring

IBM MQ for z/OS · Enterprise Messaging Architecture

05b

COBOL MQI Program Structure

IBM MQ for z/OS · Enterprise Messaging Architecture

06

CICS Integration — The MQ Adapter

CICS-MQ Adapter

CICS-MQ Bridge (MQCIH)

CKTI Trigger Monitor

IBM MQ for z/OS · Enterprise Messaging Architecture

06b

CICS-MQ Message Flow Patterns

Inbound Request Pattern (CKTI-triggered)

Trigger fires when message arrives. CKTI starts CICS transaction. Transaction MQGETs and processes. MQCMIT to confirm.

Outbound Request Pattern (CICS → MQ → Batch)

Async decoupling. CICS puts and commits immediately. Batch picks up asynchronously. Correlation via MQMD.CorrelId.

MQCIH Structure

IBM MQ for z/OS · Enterprise Messaging Architecture

07

Batch MQ Processing on z/OS

JCL Setup for Batch MQ Programs

Batch Processing Patterns

IBM MQ for z/OS · Batch Processing

07b

Key Copybook Structure Field Reference

MQMD — Message Descriptor

MQPMO — Put Message Options

MQGMO — Get Message Options

IBM MQ for z/OS · Field Reference Guide

08

Security on IBM MQ for z/OS

RACF

MSTR

QUEUE MANAGER

CHINIT

CICS Region

Batch Job

Ext. Client / Channel

RACF Integration

<div style="display:flex; align-items:flex-start;"><span style="color:#2ecc71; margin-right:12px; font-size:20px; line-height:1.2;">•</span><span style="flex:1;">Queue manager runs under a dedicated RACF User ID</span></div><div style="display:flex; align-items:flex-start;"><span style="color:#2ecc71; margin-right:12px; font-size:20px; line-height:1.2;">•</span><span style="flex:1;">MQ uses RACF to control access to: Queues, QMGRs, Processes, Namelists, Topics</span></div><div style="display:flex; align-items:flex-start;"><span style="color:#2ecc71; margin-right:12px; font-size:20px; line-height:1.2;">•</span><span style="flex:1;">RACF resource classes: MQQUEUE, MQCMDS, MQADMIN</span></div><div style="display:flex; align-items:flex-start;"><span style="color:#2ecc71; margin-right:12px; font-size:20px; line-height:1.2;">•</span><span style="flex:1;">Each CICS region and batch job connects under its own RACF ID</span></div><div style="display:flex; align-items:flex-start;"><span style="color:#2ecc71; margin-right:12px; font-size:20px; line-height:1.2;">•</span><span style="flex:1;">In multilevel-secure environments: separate QMs per security classification</span></div>

CHLAUTH Rules

<div style="display:flex; align-items:flex-start;"><span style="color:#2ecc71; margin-right:12px; font-size:20px; line-height:1.2;">•</span><span style="flex:1;">Channel Authentication Records control which connections are allowed</span></div><div style="display:flex; align-items:flex-start;"><span style="color:#2ecc71; margin-right:12px; font-size:20px; line-height:1.2;">•</span><span style="flex:1;">Blocks all channel connections by default — explicit rules required</span></div><div style="display:flex; align-items:flex-start;"><span style="color:#2ecc71; margin-right:12px; font-size:20px; line-height:1.2;">•</span><span style="flex:1;">Match on: channel name, client IP address, SSLPEER (TLS certificate DN)</span></div><div style="display:flex; align-items:flex-start;"><span style="color:#2ecc71; margin-right:12px; font-size:20px; line-height:1.2;">•</span><span style="flex:1;">Actions: ALLOW, BLOCK, or MAP to a specific MCAUSER</span></div><div style="display:flex; align-items:flex-start;"><span style="color:#2ecc71; margin-right:12px; font-size:20px; line-height:1.2;">•</span><span style="flex:1;">Replaces deprecated SSLPEER and MCAxxx channel attributes</span></div><div style="display:flex; align-items:flex-start;"><span style="color:#2ecc71; margin-right:12px; font-size:20px; line-height:1.2;">•</span><span style="flex:1;">SET CHLAUTH command managed seamlessly via MQSC</span></div>

TLS on z/OS Channels

<div style="display:flex; align-items:flex-start;"><span style="color:#2ecc71; margin-right:12px; font-size:20px; line-height:1.2;">•</span><span style="flex:1;">TLS configured per channel via SSLCIPH attribute</span></div><div style="display:flex; align-items:flex-start;"><span style="color:#2ecc71; margin-right:12px; font-size:20px; line-height:1.2;">•</span><span style="flex:1;">z/OS uses SAF Keyring (RACF) to store certificates — no file-based keystores</span></div><div style="display:flex; align-items:flex-start;"><span style="color:#2ecc71; margin-right:12px; font-size:20px; line-height:1.2;">•</span><span style="flex:1;">SSLKEYR = 'user/keyring-name' defined in CHINIT startup parameters</span></div><div style="display:flex; align-items:flex-start;"><span style="color:#2ecc71; margin-right:12px; font-size:20px; line-height:1.2;">•</span><span style="flex:1;">Modern TLS 1.2 / TLS 1.3 natively supported (MQ 9.2+)</span></div><div style="display:flex; align-items:flex-start;"><span style="color:#2ecc71; margin-right:12px; font-size:20px; line-height:1.2;">•</span><span style="flex:1;">CRL checking achieved via optimized OCSP or LDAP lookups</span></div><div style="display:flex; align-items:flex-start;"><span style="color:#2ecc71; margin-right:12px; font-size:20px; line-height:1.2;">•</span><span style="flex:1;">Key strength impacts performance: Very High Strength ≈ 2× slower channel start</span></div>

CONNAUTH — App Authentication

<div style="display:flex; align-items:flex-start;"><span style="color:#2ecc71; margin-right:12px; font-size:20px; line-height:1.2;">•</span><span style="flex:1;">CONNAUTH defines how applications explicitly authenticate to the queue manager</span></div><div style="display:flex; align-items:flex-start;"><span style="color:#2ecc71; margin-right:12px; font-size:20px; line-height:1.2;">•</span><span style="flex:1;">Can strictly require USERID + PASSWORD on MQCONN/MQCONNX call</span></div><div style="display:flex; align-items:flex-start;"><span style="color:#2ecc71; margin-right:12px; font-size:20px; line-height:1.2;">•</span><span style="flex:1;">Maps directly to RACF user validation (MQCSP structure in MQCONNX)</span></div><div style="display:flex; align-items:flex-start;"><span style="color:#2ecc71; margin-right:12px; font-size:20px; line-height:1.2;">•</span><span style="flex:1;">Prevents any anonymous fallback connections from generic batch or CICS apps</span></div><div style="display:flex; align-items:flex-start;"><span style="color:#2ecc71; margin-right:12px; font-size:20px; line-height:1.2;">•</span><span style="flex:1;">ADOPTMCA attribute on channels allows for dynamic MCA identity adoption</span></div><div style="display:flex; align-items:flex-start;"><span style="color:#2ecc71; margin-right:12px; font-size:20px; line-height:1.2;">•</span><span style="flex:1;">Enforced audit trail: all authentication events logged safely via SMF 115</span></div>

z/OS Messaging Security · Enterprise Architecture

Storage & Performance Tuning

5 KB

<strong style="color: #e8e8e8;">ECSA per concurrent logical connection.</strong> Formula: Max Connections × 5KB = ECSA requirement

3 GB+

<strong style="color: #e8e8e8;">Minimum MEMLIMIT recommended</strong> for queue manager 64-bit storage. Formula: 2GB + Total Buffer Pool sizes

5,522

<strong style="color: #e8e8e8;">Maximum SVRCONN channels</strong> in MQ 9.4 CHINIT test before hitting 80% of 31-bit storage limit

<strong style="color: #ffffff;">SQA/CSA</strong> &mdash; legacy, very limited, avoid if possible

<strong style="color: #ffffff;">ECSA</strong> &mdash; ~5KB/connection. Primary scaling constraint for CHINIT channels

<strong style="color: #ffffff;">MEMLIMIT</strong> &mdash; buffer pools, structure backups. Set MEMLIMIT=3G minimum

<strong style="color: #ffffff;">VSAM datasets</strong> &mdash; store MQ objects and message data. Num 0 to 100

<strong style="color: #ffffff;">Active &amp; Archive logs</strong> &mdash; set Log Buffer Size for high throughput

<strong style="color: #ffffff;">Set MEMLIMIT explicitly</strong> &mdash; never use NOLIMIT. Calculate: 2GB + buffer pool sizes + 500MB for RECOVER CFSTRUCT

<strong style="color: #ffffff;">Use LOCATION(ABOVE)</strong> for all buffer pools to avoid 31-bit storage pressure

<strong style="color: #ffffff;">Limit SVRCONN channels</strong> &mdash; monitor 31-bit storage with SMF 115 Class 3 trace (ACELIM)

<strong style="color: #ffffff;">Log buffer sizing</strong> &mdash; large log buffers reduce I/O. Use DSNAOINI parameters for log performance

<strong style="color: #ffffff;">TLS tradeoffs</strong> &mdash; Balance security strength vs. channel start rate. Very High Strength &approx; 50% of High Strength throughput

IBM MQ for z/OS · Storage & Performance Tuning

End-to-End z/OS MQ Architecture

IBM MQ for z/OS · Enterprise Messaging Architecture

Key Takeaways & Best Practices

IBM MQ for z/OS — Built for enterprise reliability, security and performance at scale

IBM MQ for z/OS · Enterprise Messaging Architecture

Two Address Spaces, One Queue Manager

MSTR owns MQ objects and API processing. CHINIT runs MCAs and handles all network I/O. They must always run together.

Always Use Versioned Copybooks

Use CMQMDV, CMQPMOV, CMQGMOV — not CMQMD/CMQPMO/CMQGMO. Versioned copybooks ensure new fields are accessible and Version is set correctly.

SYNCPOINT is Non-Negotiable for Critical Data

Always use MQPMO_SYNCPOINT + MQGMO_SYNCPOINT + MQCMIT for business-critical messages. On abend/disconnect, QM automatically backs out.

CSQCSTUB is Your Link to MQ in Batch & CICS

Link CSQCSTUB into COBOL programs for z/OS batch. Include SCSQLOAD in STEPLIB. In CICS, include in DFHRPL.

CHLAUTH — Default Deny, Explicit Allow

All MQ channels blocked by default. Define explicit CHLAUTH rules for each application. Map to specific MCAUSER RACF IDs.

ECSA: 5KB per Connection — Plan Ahead

Each logical connection costs ~5KB of ECSA. Max connections × 5KB = your ECSA requirement. Monitor with SMF 115 statistics.

MEMLIMIT Must Be Explicit

Never use NOLIMIT. Set MEMLIMIT = 2GB + buffer pool sizes, minimum 3GB. Add 500MB if using RECOVER CFSTRUCT.

CKTI Triggers Async CICS Processing

Use MQMONITOR + CKTI for event-driven CICS. MQ triggers start CICS transactions when messages arrive. CKAM throttles under WLM pressure.

TLS Keyring — Not Files — on z/OS

Use SAF Keyrings (RACF) for TLS certificates. No file-based keystores. SSLKEYR='user/keyring'. TLS 1.3 supported in MQ 9.2+.

Queue Sharing Groups for HA

QSGs with Coupling Facility provide active/active HA across LPARs. If one QM fails, others access shared queues. Each QM retains its own CHINIT.