Before preparing your COBOL programs, you should check with your system administrator that the COBOL compiler is set up to link with the correct C libraries. By default, the COBOL compiler Version 3.2 links to 3.0 SPARCompiler C libraries. For example, to update the compiler to link with SPARCompiler Version 4.0, ensure that your system administrator has completed the following:
cd $COBDIR/coblib
cp liblist liblist.saved
vi liblist
The COBOL compiler is now set up for you to compile COBOL programs.
Precompiled COBOL programs are supplied in the /opt/mqm/samp/bin directory. Use the Micro Focus compiler from the directory /opt/bin to build a sample from source code.
To compile, for example, the sample program amq0put0:
export COBDIR=/opt/lib/cobol export PATH=/opt/bin:$PATH export LD_LIBRARY_PATH=$COBDIR/coblib:$LD_LIBRARY_PATH
export COBCPY="/opt/mqm/inc"
Library file | Program/exit type |
---|---|
libmqmcb.so | Server for COBOL |
libmqicb.so | Client for COBOL |
cob -vxP amq0put0.cbl -lmqmcb -lmqm -lmqmcs -lmqmzse