+

Search Tips | Advanced Search

Use 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, IBM i, Linux, 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 we use the MQAI, we 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 we 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, we 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, we 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 following sample programs demonstrate the use of MQAI to perform the various tasks:

  • amqsaicq.c: create a local queue.
  • amqsaiem.c: display events on the screen using a simple event monitor.
  • amqsailq.c: print a list of all local queues and their current depths.
  • amqsaicl.c: print a list of all channels and their types.


Building your MQAI application

To build the application using the MQAI, you link to the same libraries as you do for IBM MQ. For information on how to build the 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.

Parent topic: Automating IBM MQ administration using PCF commands


Related information

Last updated: 2020-10-04