You need to link your program with one of the following:
Library file | Program/exit type |
---|---|
libmqmcb.a | Server for COBOL |
libmqicb.a | Client for COBOL |
libmqmcb_r | Server for COBOL (threaded application) |
You can use the IBM COBOL Set compiler or Micro Focus COBOL compiler depending on the program:
and
Sample COBOL programs are supplied with WebSphere MQ. To compile such a program, enter:
cob2 -o amq0put0 amq0put0.cbl -L/usr/mqm/lib -lmqmcb -qLIB -I/usr/mqm/inc
Set environment variables before compiling your program as follows:
export COBCPY=/usr/mqm/inc export LIB=/usr/mqm/lib;$LIB
To compile a COBOL program using Micro Focus COBOL, enter:
cob -xvP amq0put0.cbl -lmqmcb
See the Micro Focus COBOL documentation for a description of the environment variables that need to be set up.