[UNIX, Linux, Windows, IBM i]

Using the MQAI to simplify the use of PCFs

The IBM® MQ Administration Interface (MQAI) is a programming interface to IBM MQ that is available on AIX®, HP-UX, IBM i, Linux®, Solaris, and Windows. It performs administration tasks on an IBM MQ queue manager using data bags to handle properties (or parameters) of objects in a way that is easier than using Programmable Command Formats (PCFs).

The MQAI performs administration tasks on a queue manager through the use of data bags. Data bags allow you to handle properties (or parameters) of objects in a way that is easier than using PCFs.

The advantages of using the MQAI are as follows:
Simplify the use of PCF messages
The MQAI is an easier way to administer IBM MQ. If you use the MQAI, you do not have to write your own PCF messages. This avoids the problems associated with complex data structures.

To pass parameters in programs written using MQI calls, the PCF message must contain the command, and details of the string or integer data. To create this configuration manually, you have to add several statements in your program for every structure, and you have to allocate memory space. This task can be long and laborious.

Programs written using the MQAI pass parameters into the appropriate data bag, and you need only one statement for each structure. The use of the MQAI data bags removes the need for you to handle arrays and allocate storage, and provides some degree of isolation from the details of the PCF.

Handle error conditions more easily
It is difficult to get return codes back from PCF commands. The MQAI makes it easier for the program to handle error conditions.
Exchange data between applications
The application data is sent in PCF format and packed and unpacked by the MQAI. If your message data consists of integers and character strings, you can use the MQAI to take advantage of IBM MQ built-in data conversion for PCF data. This avoids the need to write data-conversion exits.

After you have created and populated your data bag, you can send an administration command message to the command server of a queue manager, using the mqExecute call. This call waits for any response messages. The mqExecute call handles the exchange with the command server, and returns responses in a response bag.

Examples of using the MQAI

The list shown gives some example programs that demonstrate the use of MQAI. The samples perform the following tasks:
  1. Create a local queue. Sample C program for creating a local queue (amqsaicq.c)
  2. Display events on the screen using a simple event monitor. Sample C program for displaying events using an event monitor (amqsaiem.c)
  3. Print a list of all local queues and their current depths. Sample C program for inquiring about queues and printing information (amqsailq.c)
  4. Print a list of all channels and their types. Sample C program for inquiring channel objects (amqsaicl.c)

Building your MQAI application

To build your application using the MQAI, you link to the same libraries as you do for IBM MQ. For information on how to build your IBM MQ applications, see Building a procedural application.

Hints and tips for configuring IBM MQ using MQAI

The MQAI uses PCF messages to send administration commands to the command server rather than dealing directly with the command server itself. Tips for configuring IBM MQ using the MQAI can be found in Hints and tips for using MQAI to configure IBM MQ.