IBM MQ and the z/OS Batch, TSO, and RRS adapters
Use this topic to understand how IBM MQ works with the z/OS® Batch, TSO, and RRS adapters.
Introduction to the Batch adapters
The Batch/TSO adapters are the interface between z/OS application programs running under JES, TSO, or UNIX and Linux System Services and IBM MQ. They enable z/OS application programs to use the MQI.
The adapters provide access to IBM MQ resources for programs running in the following modes or states:
- Task (TCB) mode
- Problem or supervisor state
- Non-cross-memory mode
- Non-access register mode
Connections between application programs and IBM MQ are at the task level. The adapters provide a connection thread from an application task control block (TCB) to IBM MQ.
The Batch/TSO adapter supports a single-phase commit protocol for changes made to resources owned by IBM MQ. It does not support multi-phase commit protocols. The RRS adapter enables IBM MQ applications to participate in two-phase commit protocols with other RRS-enabled products, coordinated by z/OS Resource Recovery Services (RRS).
The adapters use the z/OS STIMERM service to schedule an asynchronous event every second. This event runs an interrupt request block (IRB) that does not involve any waiting by the batch application's task. This IRB checks to see if the IBM MQ termination ECB has been posted. If the termination ECB has been posted, the IRB posts any application ECBs that are waiting on an event in IBM MQ (for example, a signal or a wait).
The Batch/TSO adapter
The IBM MQ Batch/TSO adapter provides IBM MQ support for z/OS Batch and TSO applications. All application programs that run under z/OS Batch or TSO must have the API stub program CSQBSTUB link-edited with them. The stub provides the application with access to all MQI calls. We use single-phase commit and backout for applications by issuing the MQI calls MQCMIT and MQBACK.
The RRS adapter
Resource Recovery Services (RRS) is a subcomponent of z/OS that provides a system-wide service for coordinating two-phase commit across z/OS products. The IBM MQ Batch/TSO RRS adapter (the RRS adapter) provides IBM MQ support for z/OS Batch and TSO applications that want to use these services. The RRS adapter enables IBM MQ to become a full participant in RRS coordination. Applications can participate in two-phase commit processing with other products that support RRS (for example, Db2® ).
The RRS adapter provides two stubs; you must link-edit application programs that want to use RRS with one of these stubs.
- CSQBRSTB
- This stub allows you to use two-phase commit and backout for applications by using the RRS callable resource recovery services instead of the MQI calls MQCMIT and MQBACK.
You must also link-edit module ATRSCSS from library SYS1.CSSLIB with our application. If we use the MQI calls MQCMIT and MQBACK, you will receive return code MQRC_ENVIRONMENT_ERROR.
- CSQBRRSI
- This stub allows you to use MQI calls MQCMIT and MQBACK ; IBM MQ actually implements these calls as the SRRCMIT and SRRBACK RRS calls.
For information about building application programs that use the RRS adapter, see The RRS batch adapter.
Where to find more information about the z/OS Batch, TSO, and RRS adapters
We can find more information about the topics in this section in the following sources:
Table 1. Where to find more information about using z/OS Batch with IBM MQ Topic Where to look Setting up the Batch adapters
Task 19: Set up Batch, TSO, and RRS adapters RRS callable resource recovery services
MVS Programming: Callable Services for High Level Languages