Prepare COBOL programs
Notes to users
- The 32-bit COBOL copy books are installed in the following directory:
C:\ProgramFiles\IBM\WebSphere MQ\Tools\cobol\CopyBookThe 64-bit COBOL copy books are installed in the following directory:
C:\ProgramFiles\IBM\WebSphere MQ\Tools\cobol\CopyBook64- In the following examples set CopyBook to:
CopyBookfor 32-bit applications, and:CopyBook64for 64-bit applications.
To prepare COBOL programs on Windows systems, link your program to one of the following libraries provided by WebSphere MQ:
Library file Program or exit type MQMCBB server for IBM COBOL MQMCB32 server for Micro Focus COBOL MQICCBB client for IBM COBOL MQICCB32 client for Micro Focus COBOL When you are running a program in the MQI client environment, ensure that the DOSCALLS library appears before any COBOL or WebSphere MQ library.
We can use the IBM COBOL Set compiler or Micro Focus COBOL compiler depending on the program:
- Programs beginning amqi are suitable for the IBM COBOL Set compiler,
- Programs beginning amqm are suitable for the Micro Focus COBOL compiler, and
- Programs beginning amq0 are suitable for either compiler.
Micro Focus
Relink any existing WebSphere MQ Micro Focus COBOL programs using either mqmcb32.lib or mqiccb32.lib, rather than the mqmcbb and mqiccbb libraries.
To compile, for example, the sample program amq0put0, using IBM VisualAge COBOL:
- Set the SYSLIB environment variable to include the path to the WebSphere MQ VisualAge COBOL copybooks (enter the following on one line):
set SYSLIB=<drive>:\Program Files\IBM\WebSphere MQ\ Tools\Cobol\Copybook\VAcobol;%SYSLIB%- For use on the WebSphere MQ server:
cob2 amq0put0.cbl -qlib "<drive>:\Program Files\IBM\WebSphere MQ\ Tools\Lib\mqmcbb.lib"- For use on the WebSphere MQ client:
cob2 amq0put0.cbl -qlib "<drive>:\Program Files\IBM\WebSphere MQ\ Tools\Lib\mqiccbb.lib"Although use the compiler option CALLINT(SYSTEM), this is the default for cob2.
To compile, for example, the sample program amq0put0, using Micro Focus COBOL:
- Set the COBCPY environment variable to point to the WebSphere MQ COBOL copybooks (enter the following on one line):
set COBCPY=<drive>:\Program Files\IBM\WebSphere MQ\ Tools\Cobol\Copybook- Compile the program to give you an object file:
cobol amq0put0 LITLINK- Link the object file to the runtime system.
- Set the LIB environment variable to point to the compiler COBOL libraries.
- Link the object file for use on the WebSphere MQ server:
cbllink amq0put0.obj mqmcb32.lib- Or link the object file for use on the WebSphere MQ client:
cbllink amq0put0.obj mqiccb32.lib
Parent topic:
Building a WebSphere MQ application
fg16690_