Preparing COBOL programs in Solaris

Learn about preparing COBOL programs in Solaris.

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

  1. 32 bit COBOL copy books are installed in the following directory:
    MQ_INSTALLATION_PATH/inc/cobcpy32
    
    and symbolic links are created in:
    MQ_INSTALLATION_PATH/inc
    
  2. 64 bit COBOL copy books are installed in the following directory:
    MQ_INSTALLATION_PATH/inc/cobcpy64
    
  3. In the following examples set COBCPY to:
    MQ_INSTALLATION_PATH/inc/cobcpy32
    
    for 32 bit applications, and:
    MQ_INSTALLATION_PATH/inc/cobcpy64
    
    for 64 bit applications.
Compile the programs using Micro Focus compiler. The copy files that declare the structures are in MQ_INSTALLATION_PATH/inc:

  • $ export LIB= MQ_INSTALLATION_PATH/lib:$LIB
  • $ export COBCPY=COBCPY_VALUE
Compiling 32 bit programs:

  • $ cob32 -xv amqs0put0.cbl -L MQ_INSTALLATION_PATH/lib -lmqmcb

    Server for COBOL

  • $ cob32 -xv amqs0put0.cbl -L MQ_INSTALLATION_PATH/lib -lmqicb

    Client for COBOL

  • $ cob32 -xtv amqs0put0.cbl -L MQ_INSTALLATION_PATH/lib -lmqmcb_r

    Threaded Server for COBOL

  • $ cob32 -xtv amqs0put0.cbl -L MQ_INSTALLATION_PATH/lib -lmqicb_r

    Threaded Client for COBOL

Compiling 64-bit programs:

  • $ cob64 -xv amqs0put0.cbl -L MQ_INSTALLATION_PATH/lib64 -lmqmcb

    Server for COBOL

  • $ cob64 -xv amqs0put0.cbl -L MQ_INSTALLATION_PATH/lib64 -lmqicb

    Client for COBOL

  • $ cob64 -xtv amqs0put0.cbl -L MQ_INSTALLATION_PATH/lib64 -lmqmcb_r

    Threaded Server for COBOL

  • $ cob64 -xtv amqs0put0.cbl -L MQ_INSTALLATION_PATH/lib64 -lmqicb_r

    Threaded Client for COBOL

where amqs0put0.cbl is a sample program. You must link your program with one of the following:

  • libmqmcb.so

    Server for COBOL

  • libmqicb.so

    Client for COBOL