Preparing COBOL programs

You must compile your COBOL programs using the Micro Focus Cobol compiler for SINIX with the LITLINK directive.

You must 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
libmqmcbrt.o WebSphere MQ COBOL run-time
libmqmcb.so server for COBOL
libmqicb.so client for COBOL

Export the following variables:

  COBDIR=/usr/opt/lib/cobol   export COBDIR
  COBLIB=$COBDIR/coblib   export COBLIB
  COBCPY=/opt/mqm/inc   export COBCPY
  LD_LIBRARY_PATH=/opt/lib/cobol/coblib   export LD_LIBRARY_PATH

Compiling COBOL programs

To compile a COBOL program like amq0gbr0.cbl on MQSeries for SINIX and DC/OSx, enter:

  $ cob -xU -C warning=2 amq0gbr0.cbl -lmqmcb -lmqm    \
  -lmqmcs -lmqmzse -lmproc

For DC/OSx Version cd087, include -liconv -lresolv on the above command. In the same way, for versions preceding cd087 of DC/OSx, include -liconv.

If you want to use the programs on a machine which only has WebSphere MQ client connections, recompile the programs and link them with the mqicb library instead of the mqmcb library.

Note:
The mqicb and mqmcb libraries must come before the mqm library on the above command line.

If you have DCE, you can link your COBOL batch programs with either DCE threaded libraries or non-DCE threaded libraries.

Notes:

  1. A single program cannot contain both DCE threaded and non-DCE threaded modules.

  2. Programs running under CICS must always be DCE threaded.

  3. DCE threaded libraries are referred to as re-entrant.

If you do not choose to use DCE threaded libraries, remove /opt/dcelocal/bin from your PATH environment variable before calling the COBOL compiler.

If you do choose to use DCE threaded libraries, export the following:

   $ export COBLIBLIST="/opt/lib/cobol/coblib/liblist_r"
Note:
COBLIBLIST is used only in the Micro Focus Compiler for SINIX. It is the same as the Micro Focus Compiler expression LIBLIST.


© IBM Corporation 1993, 2002. All Rights Reserved