Use the sample programs on Multiplatforms

These sample procedural programs are delivered with the product. The samples are written in C and COBOL, and demonstrate typical uses of the Message Queue Interface (MQI).


The samples are not intended to demonstrate general programming techniques, so some error checking that you might want to include in a production program is omitted.

The source code for all the samples is provided with the product; this source includes comments that explain the message queuing techniques demonstrated in the programs.

For RPG programming, see IBM i Application Programming Reference (ILE/RPG).

The names of the samples start with the prefix amq. The fourth character indicates the programming language, and the compiler where necessary:

  • s: C language
  • 0: COBOL language on both IBM and Micro Focus compilers
  • i: COBOL language on IBM compilers only
  • m: COBOL language on Micro Focus compilers only

The eighth character of the executable indicates whether the sample runs in local binding mode or client mode. If there is no eighth character, then the sample runs in local bindings mode. If the eighth character is 'c' then the sample runs in client mode.

Before we can run the sample applications, we must first create and configure a queue manager. To set up the queue manager to accept client connections, see Configure a queue manager to accept client connections on Windows, UNIX and IBM i.

Parent topic: Use the IBM MQ sample procedural programs


Related concepts


Related tasks