COBOL copy files

For COBOL, WebSphere MQ provides separate copy files containing the named constants, and two copy files for each of the structures. There are two copy files for each structure because each is provided both with and without initial values:

Copy files containing data and interface definitions for WebSphere MQ for iSeries are provided for ILE COBOL programs using prototyped calls to the MQI. The files exist in QMQM/QCBLLESRC with member names that have a suffix of "L" (for structures without initial values) or a suffix of "V" (for structures with initial values).

The WebSphere MQ interfaces for OPM COBOL have been created to maintain compatibility with previous releases, but do not provide support for new function. Consequently, the copy files provided for OPM COBOL programs are at the MQSeries for AS/400 Version 4 Release 2.1 level.

The WebSphere MQ COBOL copy files are listed in Table 73. They are installed in the following directories:

Platform Installation directory or library
AIX /usr/mqm/inc/
Compaq OpenVMS Alpha /mqm/inc/
Other UNIX platforms /opt/mqm/inc/
OS/2 \mqm\tools\cobol\copybook (for Micro Focus COBOL) \mqm\tools\cobol\copybook\VAcobol (for IBM VisualAge COBOL)
Windows \Program Files\IBM\WebSphere MQ\Tools\cobol\copybook (for Micro Focus COBOL) \Program Files\IBM\WebSphere MQ\Tools\cobol\copybook\VAcobol (for IBM VisualAge COBOL)
z/OS thlqual.SCSQCOBC
Compaq NonStop Kernel $volume.zmqslib
VSE/ESA PRD2.MQSERIES

Notes:

  1. For OS/400, they are supplied in the library QMQM:
    1. For OPM, they are supplied as members of the file QLBLSRC.
    2. For ILE, they are supplied as members of the file QCBLLESRC.

  2. For Compaq NonStop Kernel, all the sections are contained in one ENSCRIBE file CMCPCOBOL.

Table 73. COBOL copy files

File name
(with initial values)
File name
(without initial values)
Contents
CMQBOV (not OS/400) CMQBOL (not OS/400) Begin options structure (MQBO)
CMQCFV (z/OS only) not applicable Additional named constants for events and PCF commands
CMQCIHV CMQCIHL CICS information header structure
CMQCNOV CMQCNOL Connect options structure (MQCNO)
CMQDHV CMQDHL Distribution header structure (MQDH)
CMQDLHV CMQDLHL Dead-letter (undelivered-message) header structure (MQDLH)
CMQDXPV CMQDXPL Data-conversion exit parameter structure (MQDXP)
CMQGMOV CMQGMOL Get-message options structure (MQGMO)
CMQIIHV CMQIIHL IMS header structure (MQIIH)
CMQMDEV CMQMDEL Message descriptor extension structure (MQMDE)
CMQMDV CMQMDL Message descriptor structure (MQMD)
CMQODV CMQODL Object descriptor structure (MQOD)
CMQORV CMQORL Object record structure (MQOR)
CMQPMOV CMQPMOL Put-message options structure (MQPMO)
CMQRFHV CMQRFHL Rules and formatting header structure
CMQRFH2V CMQRFH2L Rules and formatting header 2 structure
CMQRRV CMQRRL Response record structure (MQRR)
CMQTMCV CMQTMCL Trigger-message structure (character format)
CMQTMC2V CMQTMC2L Trigger-message structure (character format) (MQTMC)
CMQTMV CMQTML Trigger-message structure (MQTM)
CMQV not applicable Named constants for the MQI
CMQWIHV CMQWIHL Work-information header structure
CMQXQHV CMQXQHL Transmission-queue header structure (MQXQH)
CMQXV not applicable Named constants for exits

Include in your program only those files you need. Do this with one or more COPY statements after a level-01 declaration. This means you can include multiple versions of the structures in a program if necessary. However, note that CMQV is a large file.

Here is an example of COBOL code for including the CMQMDV copy file:

01 MQM-MESSAGE-DESCRIPTOR.
   COPY CMQMDV.

Each structure declaration begins with a level-10 item; this means you can declare several instances of the structure by coding the level-01 declaration followed by a COPY statement to copy in the remainder of the structure declaration. To refer to the appropriate instance, use the IN keyword.

Here is an example of COBOL code for including two instances of CMQMDV:

* Declare two instances of MQMD
 01  MY-CMQMD.
     COPY CMQMDV.
 01  MY-OTHER-CMQMD.
     COPY CMQMDV.
*
* Set MSGTYPE field in MY-OTHER-CMQMD
     MOVE MQMT-REQUEST TO MQMD-MSGTYPE IN MY-OTHER-CMQMD.

The structures should be aligned on 4-byte boundaries. If you use the COPY statement to include a structure following an item that is not the level-01 item, try to ensure that the structure is a multiple of 4-bytes from the start of the level-01 item. If you do not do this, you may get a reduction in the performance of your application.

The structures are described in WebSphere MQ Application Programming Reference. The descriptions of the fields in the structures show the names of fields without a prefix. In COBOL programs you must prefix the field names with the name of the structure followed by a hyphen, as shown in the COBOL declarations. The fields in the structure copy files are prefixed this way.

The field names in the declarations in the structure copy files are in uppercase. You can use mixed case or lowercase instead. For example, the field StrucId of the MQGMO structure is shown as MQGMO-STRUCID in the COBOL declaration and in the copy file.

The V-suffix structures are declared with initial values for all of the fields, so you need to set only those fields where the value required is different from the initial value.



© IBM Corporation 1993, 2002. All Rights Reserved