Samples for IBM i
The techniques demonstrated by the sample programs for IBM MQ on IBM i systems.
Table 1 shows the techniques demonstrated by the IBM MQ for IBM i sample programs. Some techniques occur in more than one sample program, but only one program is listed in the table.Technique | C (source) ( 1 ) | COBOL (source) ( 2 ) | RPG (source) ( 3 ) | Client (C executable)(4) |
---|---|---|---|---|
Put messages using the MQPUT call | AMQSPUT0 | AMQ0PUT4 | AMQ3PUT4 | AMQSPUTC |
Put messages from a data file using the MQPUT call | AMQSPUT4 | no sample | no sample | no sample |
Put a single message using the MQPUT1 call | AMQSINQ4, AMQSECH4 | AMQ0INQ4, AMQ0ECH4 | AMQ3INQ4, AMQ3ECH4 | AMQSINQC, AMQSECHC |
Put messages to a distribution list | AMQSPTL4 | no sample | no sample | AMQSPTLC |
Replying to a request message | AMQSINQ4 | AMQ0INQ4 | AMQ3INQ4 | AMQSINQC |
Getting messages (no wait) | AMQSGBR4 | AMQ0GBR4 | AMQ3GBR4 | AMQSGBRC |
Getting messages (wait with a time limit) | AMQSGET4 | AMQ0GET4 | AMQ3GET4 | AMQSGETC |
Getting messages (unlimited wait) | AMQSTRG4 | no sample | AMQ3TRG4 | AMQSTRGC |
Getting messages (with data conversion) | AMQSECH4 | AMQ0ECH4 | AMQ3ECH4 | AMQSECHC |
Put Reference Messages to a queue | AMQSPRM4 | no sample | no sample | AMQSPRMC |
Getting Reference Messages from a queue | AMQSGRM4 | no sample | no sample | AMQSGRMC |
Reference Message channel exit | AMQSQRM4, AMQSXRM4 | no sample | no sample | no Sample |
Message exit | AMQSCMX4 | no sample | no sample | no Sample |
Browsing first 49 characters of a message | AMQSGBR4 | AMQ0GBR4 | AMQ3GBR4 | AMQSGBRC |
Browsing complete messages | AMQSBCG4 | no sample | no sample | AMQSBCGC |
Use a shared input queue | AMQSINQ4 | AMQ0INQ4 | AMQ3INQ4 | AMQSINQC |
Use an exclusive input queue | AMQSREQ4 | AMQ0REQ4 | AMQ3REQ4 | AMQSREQC |
Use the MQINQ call | AMQSINQ4 | AMQ0INQ4 | AMQ3INQ4 | AMQSINQC |
Use the MQSET call | AMQSSET4 | AMQ0SET4 | AMQ3SET4 | AMQSSETC |
Use a reply-to queue | AMQSREQ4 | AMQ0REQ4 | AMQ3REQ4 | AMQSREQC |
Requesting message exceptions | AMQSREQ4 | AMQ0REQ4 | AMQ3REQ4 | AMQSREQC |
Accepting a truncated message | AMQSGBR4 | AMQ0GBR4 | AMQ3GBR4 | AMQSGBRC |
Use a resolved queue name | AMQSGBR4 | AMQ0GBR4 | AMQ3GBR4 | AMQSGBRC |
Triggering a process | AMQSTRG4 | no sample | AMQ3TRG4 | AMQSTRGC |
Trigger server | AMQSERV4 | no sample | AMQ3SRV4 | no sample |
Use a trigger server (including CICS transactions) | AMQSERV4 | no sample | AMQ3SRV4 | no sample |
Use data conversion | AMQSVFC4 | no sample | no sample | no sample |
Use API exits | AMQSAXE0 | no sample | no sample | no sample |
Cluster workload balancing | AMQSWLM0 | no sample | no sample | no sample |
Put messages asynchronously and getting status using the MQSTAT call | AMQSAPT0 | no sample | no sample | AMQSAPTC |
Use the publish/subscribe interface | AMQSPUBA, AMQSSUBA, AMQSSBXA | no sample | no sample | AMQSPUBC, AMQSSUBC, AMQSSBXC |
Reconnectable clients (5) | AMQSPHAC, AMQSGHAC, AMQSMHAC | no sample | no sample | no sample |
Use message consumers to asynchronously consume messages from multiple queues (5) | AMQSCBFO | no sample | no sample | no sample |
Specify TLS connection information on MQCONNX | AMQSSSLC | no sample | no sample | AMQSSSLC |
Connect to the queue manager using MQCONNX | AMQSCNXC | no sample | no sample | AMQSCNXC |
- Source for the C samples is in the file QMQMSAMP/QCSRC. Include files exist as members in the file QMQM/H.
- Source for the COBOL samples are in the files QMQMSAMP/QCBLLESRC. The members are named AMQ0 xxx 4, where xxx indicates the sample function.
- Source for the RPG samples is in QMQMSAMP/QRPGLESRC. Members are named AMQ3 xxx 4, where xxx indicates the sample function. Copy members exist in QMQM/QRPGLESRC. Each member name has the suffix G.
- The executable version of the IBM MQ MQI client samples share the same source as the samples that run in a server environment. Source for the samples in the client environment is same as the server. IBM MQ MQI client samples are linked with client library LIBMQIC and IBM MQ server samples are linked with server library LIBMQM.
- If client executable for sample application of Reconnectable client and asynchronously consumer
application has to be run, it has to be compiled and linked with threaded library LIBMQIC_R. Hence, it has to be run in threaded environment.
Set the environment variable QIBM_MULTI_THREADED to
'Y' and run the application from qsh.
See Set up IBM MQ with Java and JMS for more information.
In addition to these, the IBM MQ for IBM i sample option includes a sample data file, which we use as input to the sample programs, AMQSDATA and sample CL programs that demonstrate administration tasks. The CL samples are described in the Administer IBM i . You could use the sample CL program amqsamp4 to create queues to use with the sample programs described in this topic.
Parent topic: Features demonstrated in the sample programs on Multiplatforms