Preparing COBOL programs in HP-UX

Learn about preparing COBOL programs in HP-UX, using Micro Focus Server Express with IBM MQ on the IA64 (IPF) platform, and running programs in the IBM MQ MQI client environment.

MQ_INSTALLATION_PATH represents the high-level directory in which IBM MQ is installed.

Usage notes:
  1. 32 bit COBOL copy books are installed in the following directory:
    MQ_INSTALLATION_PATH/inc/cobcpy32
    
    and symbolic links are created in:
    MQ_INSTALLATION_PATH/inc
    
  2. 64 bit COBOL copy books are installed in the following directory:
    MQ_INSTALLATION_PATH/inc/cobcpy64
    
  3. In the following examples set COBCPY to:
    MQ_INSTALLATION_PATH/inc/cobcpy32
    
    for 32 bit applications, and:
    MQ_INSTALLATION_PATH/inc/cobcpy64
    
    for 64 bit applications.
Compile the programs using the Micro Focus compiler. The copy files that declare the structures are in MQ_INSTALLATION_PATH/inc:
  $ export LIB= MQ_INSTALLATION_PATH/lib:$LIB
  $ export COBCPY="COBCPY_VALUE"
Compiling 32 bit programs:
  $ cob32 -xv amqsput.cbl -L MQ_INSTALLATION_PATH/lib -lmqmcb Server for COBOL
  $ cob32 -xv amqsput.cbl -L MQ_INSTALLATION_PATH/lib -lmqicb Client for COBOL
  $ cob32 -xtv amqsput.cbl -L MQ_INSTALLATION_PATH/lib -lmqmcb_r Threaded Server for COBOL
  $ cob32 -xtv amqsput.cbl -L MQ_INSTALLATION_PATH/lib -lmqicb_r Threaded Client for COBOL
Compiling 64 bit programs:
  $ cob64 -xv amqsput.cbl -L MQ_INSTALLATION_PATH/lib64 -lmqmcb Server for COBOL
  $ cob64 -xv amqsput.cbl -L MQ_INSTALLATION_PATH/lib64 -lmqicb Client for COBOL
  $ cob64 -xtv amqsput.cbl -L MQ_INSTALLATION_PATH/lib64 -lmqmcb_r Threaded Server for COBOL
  $ cob64 -xtv amqsput.cbl -L MQ_INSTALLATION_PATH/lib64 -lmqicb_r Threaded Client for COBOL
where amqsput is a sample program

Ensure that we have specified adequate runtime stack sizes; 16 KB is the recommended minimum.

You need to link your programs with the appropriate library provided by IBM MQ. The following table shows which library to use in different environments

Hardware platform Program/exit type Library file
IA64 (IPF) Server for COBOL libmqmcb.so
IA64 (IPF) Client for COBOL libmqicb.so
IA64 (IPF) Threaded applications libmqmcb_r.so


Use Micro Focus Server Express with IBM MQ on the IA64 (IPF) platform

See Address Space models supported by IBM MQ for HP-UX on IA64 (IPF) for details on using Micro Focus Server Express in conjunction with IBM MQ on the HP/IPF platform.


Programs to run in the IBM MQ MQI client environment

If you are using LU 6.2 to connect your MQI client to a server, link our application to libsna.a, part of the SNAplusAPI product. Use the -lV3 and -lstr options on your compiling and linking command.

  • The -lV3 option gives your program access to the AT&T signaling library (the SNAplusAPI uses AT&T signals)
  • The -lstr option links your program to the streams component