Prepare COBOL programs

 

Notes to users

  1. The 32-bit COBOL copy books are installed in the following directory:
    C:\ProgramFiles\IBM\WebSphere MQ\Tools\cobol\CopyBook

  2. The 64-bit COBOL copy books are installed in the following directory:

    C:\ProgramFiles\IBM\WebSphere MQ\Tools\cobol\CopyBook64

  3. In the following examples set CopyBook to:
    CopyBook
    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 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:

 

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:

  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. For use on the WebSphere MQ server:
      cob2 amq0put0.cbl -qlib "<drive>:\Program Files\IBM\WebSphere MQ\
      Tools\Lib\mqmcbb.lib"

  3. 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:

  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 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_