Connect from the IMS control region

Use this topic to understand the mechanisms available to connect from IMS to IBM MQ .

IMS makes one connection from its control region to each queue manager that uses IMS. IMS must be enabled to make the connection in one of these ways:

  • Automatically during either:

    • A cold start initialization.
    • A warm start of IMS, if the IBM MQ connection was active when IMS was shut down.

  • In response to the IMS command:
    /START SUBSYS sysid
    

    where sysid is the queue manager name.

    The command can be issued regardless of whether the queue manager is active.

The connection is not made until the first MQ API call to the queue manager is made. Until that time, the IMS command /DIS SUBSYS shows the status as 'NOT CONN'.

The order in which you start IMS and the queue manager is not significant.

IMS cannot re-enable the connection to the queue manager automatically if the queue manager is stopped with a STOP QMGR command, the IMS command /STOP SUBSYS, or an abnormal end. Therefore, you must make the connection by using the IMS command /START SUBSYS.


Initializing the adapter and connecting to the queue manager

The adapter is a set of modules loaded into the IMS control and dependent regions, using the IMS external Subsystem Attach Facility.

This procedure initializes the adapter and connects to the queue manager:
  1. Read the subsystem member (SSM) from IMS.PROCLIB. The SSM chosen is an IMS EXEC parameter. There is one entry in the member for each queue manager to which IMS can connect. Each entry contains control information about an IBM MQ adapter.
  2. Load the IMS adapter. Note: IMS loads one copy of the adapter modules for each IBM MQ instance that is defined in the SSM member.
  3. Attach the external subsystem task for IBM MQ.
  4. Run the adapter with the CTL EXEC parameter (IMSID) as the connection name.

The process is the same whether the connection is part of initialization or a result of the IMS command /START SUBSYS.

If the queue manager is active when IMS tries to make the connection, the following messages are sent:

  • to the z/OS console:
    DFS3613I ESS TCB INITIALIZATION COMPLETE
    
  • to the IMS master terminal:
    CSQQ000I IMS/TM imsid connected to queue manager ssnm
    

When IMS tries to make the connection and the queue manager is not active, the following messages are sent to the IMS master terminal each time an application makes an MQI call:

CSQQ001I IMS/TM imsid not connected to queue manager ssnm.
Notify message accepted
DFS3607I MQM1   SUBSYSTEM ID EXIT FAILURE, FC = 0286, RC = 08,
JOBNAME = IMSEMPR1
If you get DFS3607I messages when you start the connection to IMS or on system startup, this indicates that the queue manager is not available. To prevent a large number of messages being generated, we must do one of the following:
  1. Start the relevant queue manager.
  2. Issue the IMS command:
    /STOP SUBSYS
    
    so that IMS does not expect to connect to the queue manager.

If you do neither, a DFS3607I message and the associated CSQQ001I message are issued each time a job is scheduled in the region and each time a connection request to the queue manager is made by an application.


Thread attachment

In an MPP or IFP region, IMS makes a thread connection when the first application program is scheduled into that region, even if that application program does not make an IBM MQ call. In a BMP region, the thread connection is made when the application makes its first IBM MQ call ( MQCONN or MQCONNX ). This thread is retained for the duration of the region or until the connection is stopped.

For both the message driven and non-message driven regions, the recovery thread cross-reference identifier, Thread-xref, associated with the thread is:
PSTid + PSBname
where:

    PSTid
    Partition specification table region identifier

    PSBname
    Program specification block name

We can use connection IDs as unique identifiers in IBM MQ commands, in which case IBM MQ automatically inserts these IDs into any operator message that it generates.

Parent topic: Operate the IMS adapter