Preparing COBOL programs

To prepare COBOL programs on OS/2, link your programs with one of the following libraries provided by MQSeries for OS/2 Warp:

Library file Program/exit type
MQMCB16 Server for 16-bit Micro Focus COBOL
MQICCB16 Client for 16-bit Micro Focus COBOL
MQMCBB Server for 32-bit IBM VisualAge COBOL
MQMCB32 Server for 32-bit Micro Focus COBOL
MQICCBB Client for 32-bit IBM VisualAge COBOL
MQICCB32 Client for 32-bit Micro Focus COBOL

To compile, for example, the sample program amq0put0, using IBM VisualAge COBOL:

  1. Set the SYSLIB environment variable to include the path to the MQSeries for OS/2 Warp VisualAge COBOL copybooks:
      set SYSLIB=<drive>:\mqm\tools\cobol\copybook\VAcobol;%SYSLIB%
    
  2. Compile and link the program:
      cob2 amq0put0.cbl -qlib <drive>:\mqm\tools\lib\mqmcbb.lib
    

    (for use on the WebSphere MQ server)

      cob2 amq0put0.cbl -qlib <drive>:\mqm\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 prepare Micro Focus COBOL programs, follow these steps:

  1. Compile your applications with the LITLINK directive.
  2. Specify adequate run-time stack sizes. You must link a trusted application with more stack than a normal application, so a stack size of 200 KB is the recommended minimum. To do this, use:
      set cobsw=xxxx
    
  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
    
  4. Add the WebSphere MQ copybook directory (\mqm\tools\cobol\copybook) to the cobcpy environment variable.
      set cobcpy=c:\mqm\tools\cobol\copybook;%COBCPY%
    

Preparing Transaction Server programs

To prepare CICS Transaction Server for OS/2, V4 programs using IBM VisualAge COBOL:

  1. Add the following lines to the CICSENV.CMD file:
      UserWrk='c:\mqm\dll'
      UserCobol='IBM'
      UserCobcopy='c:\mqm\tools\cobol\copybook'
      UserCobWork='c:\mq-cics\wrk'
    

    Where \mq-cics\wrk is the name of a work directory for output from CICSTRAN and CICSCOMP commands (see steps 2 and 3).

  2. Translate your program:
      CICSTRAN MYPROG.CPP
    

    This translates your program to a .CBL program.

  3. Compile your program:
      CICSCOMP MYPROG.CBL
    
  4. Link your program:
      CICSLINK MYPROG.OBJ LIBS(MQMCBB)
    

For further information about this, see the CICS for OS/2 Customization V3.0, SC33-1581-00 and the Transaction Server for OS/2 Warp, V4 Application Programming Guide.



© IBM Corporation 1993, 2002. All Rights Reserved