Preparing COBOL programs

Notes to users

  1. 32 bit COBOL copy books are installed in the following directory:
    C:\ProgramFiles\<Product directory>\Tools\cobol\copyBook32
    and in directory:
    C:\ProgramFiles\<Product directory>\Tools\cobol\copyBook
  2. 64 bit COBOL copy books are installed in the following directory:

    C:\ProgramFiles\<Product directory>\Tools\cobol\copyBook32
  3. In the following examples set copyBook to:
    copyBook32
    for 32 bit applications, and:
    copyBook64
    for 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/exit type
MQMCBB server for IBM(R) 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.

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(R) COBOL:

  1. 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%
  2. Compile and link the program (enter the following examples on one line):
      cob2 amq0put0.cbl -qlib "<drive>:\Program Files\IBM\WebSphere MQ\
      Tools\Lib\mqmcbb.lib"
    (for use on the WebSphere MQ server)

      cob2 amq0put0.cbl -qlib "<drive>:\Program Files\IBM\WebSphere MQ\
      Tools\Lib\mqiccbb.lib"

    (for use on the WebSphere MQ client)

    Note:
    Although you must use the compiler option CALLINT(SYSTEM), this is the default for cob2.

To compile, for example, the sample program amq0put0, using Micro Focus COBOL:

  1. 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
  2. Compile the program to give you an object file:
      cobol amq0put0 LITLINK
  3. Link the object file to the run-time system.