Preparing CICS programs

XA switch modules are provided to enable you to link CICS with WebSphere MQ:

Table 16. Essential Code for CICS applications (AIX)

Description
C (source)
C (exec) - add to your
XAD.Stanza
XA initialization routine
amqzscix.c
amqzsc21 - CICS for AIX

Always link your transactions with the thread safe WebSphere MQ library libmqm_r.a.

Note:
On AIX Version 4, the libmqm_r.a library works with both native and DCE libraries.

Compile the program by typing:

  xlC_r4 /usr/mqm/samp/amqzscix.c -I/usr/lpp/encina/include \
  -e amqzscix -o amqzscix /usr/lpp/cics/lib/regxa_swxa.o \
  -L/usr/lpp/cics/lib -L/usr/lpp/encina/lib -lmqmcics_r -lmqmxa_r -lmqm_r \
  -lcicsrt -lEncina -lEncServer -ldce

You can find more information about supporting CICS transactions in the WebSphere MQ System Administration Guide.

CICS on Open Systems support

WebSphere MQ on UNIX systems support CICS on Open Systems via the XA interface.

You must ensure that CICS COBOL applications are linked to the threaded version of the library. CICS on Open Systems WebSphere MQ transactions must link with libmqm_r, except on Solaris, where you must link with lmqmcs_d.

You can run CICS programs using IBM COBOL SET for AIX or Micro Focus COBOL. The following sections describe the difference between these.

Preparing CICS COBOL programs using IBM COBOL SET for AIX

To use IBM COBOL, follow these steps:

  1. Export the following environment variable:
      export LDFLAGS="-qLIB -bI:/usr/lpp/cics/lib/cicsprIBMCOB.exp  \
                      -I/usr/mqm/inc -I/usr/lpp/cics/include  \
                      -e _iwz_cobol_main  \
                      -L/usr/lib/dce -lmqmcb_r -ldcelibc_r -ldcepthreads"
    

    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

To use Micro Focus COBOL, follow these steps:

  1. Add the WebSphere MQ COBOL run-time library module to the run-time library using the following command:
      cicsmkcobol -L/usr/lib/dce -L/usr/mqm/lib  \
                  /usr/mqm/lib/ libmqmcbrt.o -lmqm_r
    

    This creates the Micro Focus COBOL language method file and enables the CICS run-time COBOL library to call WebSphere MQ on UNIX systems.

    Note:
    cicsmkcobol must be run only when one of the following is installed:
    • 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)
    • CICS for AIX
  2. Export the following environment variables:
      COBCPY=/usr/mqm/inc  export COBCPY
      LDFLAGS="-L/usr/mqm/lib -lmqm_r"  export LDFLAGS
    
  3. Translate, compile, and link the program by typing:
      cicstcl -l COBOL -e <yourprog>.ccp
    

Preparing CICS C programs

You build CICS C programs using the standard CICS facilities:

  1. Export one of the following environment variables:
  2. Translate, compile, and link the program by typing:
      cicstcl -l C amqscic0.ccs
    

CICS C sample transaction

Sample C source for a CICS WebSphere 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 whose name is contained in the transmission header of the message. Any failures will be sent to the queue SYSTEM.SAMPLE.CICS.DLQ. The sample MQSC script AMQSCIC0.TST may be used to create these queues and sample input queues.



© IBM Corporation 1993, 2002. All Rights Reserved