Preparing COBOL programs

Notes to users

  1. 32 bit COBOL copy books are installed in the following directory:
    /opt/mqm/inc/cobcpy32
    and symbolic links are created in:
    /opt/mqm/inc
  2. 64 bit COBOL copy books are installed in the following directory:

    /opt/mqm/inc/cobcpy64
  3. In the following examples set COBCPY to:
    /opt/mqm/inc/cobcpy32
    for 32 bit applications, and:
    /opt/mqm/inc/cobcpy64
    for 64 bit applications.

Compile the programs using the Micro Focus compiler. The copy files that declare the structures are in /opt/mqm/inc:

  $ export LIB=/usr/mqm/lib;$LIB
  $ export COBCPY="<COBCPY>"

Compiling 32 bit programs:

  $ cob32 -xv amqsput.cbl -L /opt/mqm/lib -lmqmcb Server for COBOL
  $ cob32 -xv amqsput.cbl -L /opt/mqm/lib -lmqicb Client for COBOL
  $ cob32 -xtv amqsput.cbl -L /opt/mqm/lib -lmqmcb_r Threaded Server for COBOL
  $ cob32 -xtv amqsput.cbl -L /opt/mqm/lib -lmqicb_r Threaded Client for COBOL

Compiling 64 bit programs:

  $ cob64 -xv amqsput.cbl -L /opt/mqm/lib64 -lmqmcb Server for COBOL
  $ cob64 -xv amqsput.cbl -L /opt/mqm/lib64 -lmqicb Client for COBOL
  $ cob64 -xtv amqsput.cbl -L /opt/mqm/lib64 -lmqmcb_r Threaded Server for COBOL
  $ cob64 -xtv amqsput.cbl -L /opt/mqm/lib64 -lmqicb_r Threaded Client for COBOL

where amqsput is a sample program

Ensure that you have specified adequate run-time stack sizes; 16 KB is the recommended minimum.

You need to link your program with one of the following:

Library file Program/exit type
libmqmcb.sl Server for COBOL
libmqicb.sl Client for COBOL
amqmcb_r.sl Threaded applications