Preparing COBOL programs

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 32-bit IBM COBOL
MQMCB32 server for 32-bit Micro Focus COBOL
MQICCBB client for 32-bit IBM COBOL
MQICCB32 client for 32-bit Micro Focus COBOL
MQMCB16 server for 16-bit Micro Focus COBOL
MQICCB16 client for 16-bit Micro Focus COBOL

When you are running a program in the MQI client environment, ensure the DOSCALLS library appears before any COBOL or WebSphere MQ library.

Micro Focus

You must 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. 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 the compiler option CALLINT(SYSTEM) must be used, 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.

    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
    

Preparing CICS and Transaction Server programs

To compile and link a TXSeries for Windows NT, V4 program using IBM VisualAge COBOL:

  1. Set the environment variable (enter the following on one line):
      set CICS_IBMCOB_FLAGS=c:\Program Files\IBM\WebSphere MQ\Tools\
      Cobol\Copybook\VAcobol;%CICS_IBMCOB_FLAGS%
    
  2. Set the USERLIB environment variable:
      set USERLIB=MQMCBB.LIB
    
  3. Translate, compile, and link your program:
      cicstcl -l IBMCOB myprog.ccp
    

This is described in the Transaction Server for Windows NT, V4 Application Programming Guide.

To compile and link a CICS for Windows NT V2 program using Micro Focus COBOL:

This is described in the CICS for Windows NT V2.0 Application Programming Guide.



© IBM Corporation 1993, 2002. All Rights Reserved