Preparing COBOL programs

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:

Preparing COBOL programs using IBM COBOL SET for AIX

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
Note:
For threaded applications, cob2_r is used with the libmqmcb_r.a library.

Preparing COBOL programs using Micro Focus COBOL

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.



© IBM Corporation 1993, 2002. All Rights Reserved