Sample programs on IBM i
This topic describes the sample programs delivered with IBM MQ for IBM i for RPG. The samples 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 may want to include in a production program has been omitted. However, these samples are suitable for use as a base for your own message queuing programs.
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.
There is one set of ILE sample programs:- Programs using prototyped calls to the MQI (static bound calls)
The source exists in QMQMSAMP/QRPGLESRC. The members are named AMQ3xxx4, where xxx indicates the sample function. Copy members exist in QMQM/QRPGLESRC. Each member name has a suffix of G or H.
Table 1 gives a complete list of the sample programs delivered with IBM MQ for IBM i, and shows the names of the programs in each of the supported programming languages. Notice that their names all start with the prefix AMQ, the fourth character in the name indicates the programming language.
RPG (ILE) | |
---|---|
Put samples | AMQ3PUT4 |
Browse samples | AMQ3GBR4 |
Get samples | AMQ3GET4 |
Request samples | AMQ3REQ4 |
Echo samples | AMQ3ECH4 |
Inquire samples | AMQ3INQ4 |
Set samples | AMQ3SET4 |
Trigger Monitor sample | AMQ3TRG4 |
Trigger Server sample | AMQ3SRV4 |
In addition to these, the IBM MQ for IBM i sample option includes a sample data file, AMQSDATA, which can be used as input to certain sample programs and sample CL programs that demonstrate administration tasks. The CL samples are described in Administer IBM i . You could use the sample CL program to create queues to use with the sample programs described in this topic.
For information about how to run the sample programs, see Preparing and running the sample programs on IBM i.