TXSeries CICS support

IBM MQ on AIX supports TXSeries CICS using the XA interface. Ensure that CICS applications are linked to the threaded version of the IBM MQ libraries.

We can run CICS programs using IBM COBOL Set for AIX or Micro Focus COBOL. The following sections describe the difference between running CICS programs on IBM COBOL Set for AIX and Micro Focus COBOL.

Write IBM MQ programs that are loaded into the same CICS region in either C or COBOL. We cannot make a combination of C and COBOL MQI calls into the same CICS region. Most MQI calls in the second language used fail with a reason code of MQRC_HOBJ_ERROR.


Preparing CICS COBOL programs using IBM COBOL Set for AIX

MQ_INSTALLATION_PATH represents the high-level directory in which IBM MQ is installed.

To use IBM COBOL, follow these steps:
  1. Export the following environment variable:
      export LDFLAGS="-qLIB -bI:/usr/lpp/cics/lib/cicsprIBMCOB.exp \
                      -I MQ_INSTALLATION_PATH/inc -I/usr/lpp/cics/include \
                      -e _iwz_cobol_main  \
    

    where LIB is a compiler directive.

  2. Translate, compile, and link the program by typing:
    cicstcl -l IBMCOB yourprog.ccp
    


Preparing CICS COBOL programs using Micro Focus COBOL

MQ_INSTALLATION_PATH represents the high-level directory in which IBM MQ is installed.

To use Micro Focus COBOL, follow these steps:
  1. Add the IBM MQ COBOL runtime library module to the runtime library using the following command:
      cicsmkcobol -L/usr/lib/dce -L MQ_INSTALLATION_PATH/lib \
                  MQ_INSTALLATION_PATH/lib/libmqmcbrt.o -lmqe_r
    
    Note: With cicsmkcobol, IBM MQ does not allow you to make MQI calls in the C programming language from your COBOL application.

    If your existing applications have any such calls, we are recommended to move these functions from the COBOL applications to your own library, for example, myMQ.so. After moving the functions, do not include the IBM MQ library libmqmcbrt.o when building the COBOL application for CICS.

    Additionally, if your COBOL application does not make any COBOL MQI call, do not link libmqmz_r with cicsmkcobol.

    This creates the Micro Focus COBOL language method file and enables the CICS runtime COBOL library to call IBM MQ on UNIX and Linux systems.

    Note: Run cicsmkcobol only when you install one of the following products:

    • New version or release of Micro Focus COBOL
    • New version or release of CICS for AIX
    • New version or release of any supported database product (for COBOL transactions only)
    • New version or release of IBM MQ

  2. Export the following environment variable:
    COBCPY= MQ_INSTALLATION_PATH/inc export COBCPY
    
  3. Translate, compile, and link the program by typing:
    cicstcl -l COBOL -e yourprog.ccp
    


Preparing CICS C programs

MQ_INSTALLATION_PATH represents the high-level directory in which IBM MQ is installed.

Build CICS C programs using the standard CICS facilities:
  1. Export one of the following environment variables:

    • LDFLAGS = "-L/ MQ_INSTALLATION_PATH lib -lmqm_r" export LDFLAGS
    • USERLIB = "-L MQ_INSTALLATION_PATH lib -lmqm_r" export USERLIB

  2. Translate, compile, and link the program by typing:
    cicstcl -l C amqscic0.ccs
    

    CICS C sample transaction

    Sample C source for a AIX IBM MQ transaction is provided by AMQSCIC0.CCS. The transaction reads messages from the transmission queue SYSTEM.SAMPLE.CICS.WORKQUEUE on the default queue manager and places them onto the local queue with a queue name that is contained in the transmission header of the message. Any failures are sent to the queue SYSTEM.SAMPLE.CICS.DLQ. Use the sample MQSC script AMQSCIC0.TST to create these queues and sample input queues.

Parent topic: Preparing CICS application programs in AIX