Building applications in COBOL

This section describes how to build application programs written in COBOL to run under Compaq Tru64 UNIX.

For information on the WebSphere MQ COBOL copy files, see COBOL copy files.

Preparing COBOL programs

Use the Micro Focus COBOL compiler to compile your programs. The copy files that declare the structures are in the /opt/mqm/inc directory.

See the Micro Focus COBOL compiler documentation for a description of the environment variables that you must set up.

$ export COBDIR=/opt/cobol
$ export COBCPY=/opt/mqm/inc
$ export LD_LIBRARY_PATH=/opt/mqm/lib:$LD_LIBRARY_PATH

Here is an example instruction for building the sample program amq0put0.cbl in a nonthreaded environment:

$ cob -vxP amq0put0.cbl -lmqmcb

Here is an example instruction for building the sample program amq0put0.cbl in a threaded environment:

$ cob -vxP amq0put0.cbl -lmqmcb_r

If you want to use the programs on a machine on which only the MQSeries client for Compaq Tru64 UNIX is installed, recompile the programs to link them with the client library. Here is an example instruction for building a nonthreaded client:

$ cob -vxP amq0put0.cbl -lmqmicb

Here is an example instruction for building a threaded client:

$ cob -vxP amq0put0.cbl -lmqmicb_r

Linking libraries

You must link to one of the following libraries:

Library file Program or exit type
libmqmcb.so Server for COBOL
libmqmicb.so Client for COBOL
libmqmcb_r.so Threaded applications



© IBM Corporation 1993, 2002. All Rights Reserved