Sample programs

 

This chapter describes the sample programs delivered with WebSphere MQ for iSeries 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 are two sets of ILE sample programs:

  1. 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".

  2. Programs using the MQI through a call to QMQM (dynamic bound calls)

    These sample programs are not shipped with WebSphere MQ V6, but will support compiled versions of the program. For details of the MQI interface used by these programs, see the MQSeries for AS/400 V4R2.1 Administration Guide. Each member name has a suffix of "G" or "R".

Table 61 gives a complete list of the sample programs delivered with WebSphere MQ for iSeries V3R1 or later, 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.

Table 61. Names of the sample programs
  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 WebSphere MQ for iSeries 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 the WebSphere MQ for iSeries V6 System Administration Guide. You could use the sample CL program to create queues to use with the sample programs described in this chapter.

For information on how to run the sample programs, see Preparing and running the sample programs.