IBM MQ data definition files

IBM MQ provides data definition files to help you to write our applications.

Data definition files are also known as:

Language Data definitions
C Include files or header files
Visual Basic Module files (32-bit versions only)
COBOL Copy files
Assembler Macros
PL/I Include files

The data definition files to help you to write channel exits are described in IBM MQ COPY, header, include, and module files.

The data definition files to help you to write installable services exits are described in User exits, API exits, and IBM MQ installable services.

For data definition files supported on C++, see Use C++.

For data definition files supported on RPG, see the IBM i Application Programming Reference (ILE/RPG).

The names of the data definition files have the prefix CMQ, and a suffix that is determined by the programming language:

Suffix Language
a Assembler language
b Visual Basic
c C
l COBOL (without initialized values)
p PL/I
v COBOL (with default values set)


Installation library

The name thlqual is the high-level qualifier of the installation library on z/OSĀ®.

This topic introduces IBM MQ data definition files, under these headings:


C language include files

The IBM MQ C include files are listed in C header files. They are installed in the following directories or libraries:

Platform Installation directory or library
IBM i QMQM/H
UNIX MQ_INSTALLATION_PATH/inc/
Windows systems MQ_INSTALLATION_PATH\Tools\c\include
z/OS thlqual.SCSQC370
where MQ_INSTALLATION_PATH represents the high-level directory in which IBM MQ is installed. Note: For UNIX, the include files are symbolically linked into /usr/include.

For more information about the structure of directories, see Plan file system support.


Visual Basic module files

IBM MQ for Windows provides four Visual Basic module files.

They are listed in Visual Basic module files and installed in
MQ_INSTALLATION_PATH\Tools\Samples\VB\Include


COBOL copy files

For COBOL, IBM 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:

  • In the WORKING-STORAGE SECTION of a COBOL program, use the files that initialize the structure fields to default values. These structures are defined in the copy files that have names suffixed with the letter V (values).
  • In the LINKAGE SECTION of a COBOL program, use the structures without initial values. These structures are defined in copy files that have names suffixed with the letter L (linkage).

Copy files containing data and interface definitions for IBM i 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 IBM MQ COBOL copy files are listed in COBOL COPY files. They are installed in the following directories:

Platform Installation directory or library
Other UNIX platforms MQ_INSTALLATION_PATH/inc/
IBM i QMQM/QCBLLESRC
Windows MQ_INSTALLATION_PATH\Tools\cobol\copybook (for Micro Focus COBOL) MQ_INSTALLATION_PATH\Tools\cobol\copybook\VAcobol (for IBM VisualAgeĀ® COBOL)
z/OS thlqual.SCSQCOBC
MQ_INSTALLATION_PATH represents the high-level directory in which IBM MQ is installed.

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

Here is an example of COBOL code to include the CMQMDV copy file:
01 MQM-MESSAGE-DESCRIPTOR.
COPY CMQMDV.

Each structure declaration begins with a level-01 item; we 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 to include 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.

Align the structures on 4-byte boundaries. If we use the COPY statement to include a structure following an item that is not the level-01 item, ensure that the structure is a multiple of 4-bytes from the start of the level-01 item. If we do not do this, you might reduce the performance of our application.

The structures are described in Data types used in the MQI. The descriptions of the fields in the structures show the names of fields without a prefix. In COBOL programs, 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 in this way.

The field names in the declarations in the structure copy files are in uppercase. We 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 the fields, so you need to set only those fields where the value required is different from the initial value.

System/390 assembler-language macros

IBM MQ for z/OS provides two assembler-language macros containing the named constants, and one macro to generate each structure.

They are listed in z/OS Assembler COPY files and installed in thlqual.SCSQMACS.

These macros are called using code like this:
MY_MQMD CMQMDA EXPIRY=0,MSGTYPE=MQMT_DATAGRAM

PL/I include files

IBM MQ for z/OS provides include files that contain all the definitions that you need when you write IBM MQ applications in PL/I.

The files are listed in PL/I include files and installed in the thlqual.SCSQPLIC directory:

Include these files in your program if you are going to link the IBM MQ stub to your program (see Preparing your program to run ). Include only CMQP if you intend to link the IBM MQ calls dynamically (see Dynamically calling the IBM MQ stub ). Dynamic linking can be performed for batch and IMS programs only.