Features demonstrated in the sample programs

The following tables show the techniques demonstrated by the WebSphere MQ sample programs on all systems except z/OS (see Chapter 36, Sample programs for WebSphere MQ for z/OS). All the samples open and close queues using the MQOPEN and MQCLOSE calls, so these techniques are not listed separately in the tables. See the heading that includes the platform you are interested in:

Samples for Compaq OpenVMS Alpha and UNIX systems
Samples for MQSeries for OS/2 Warp and WebSphere MQ for Windows
PL/I samples for WebSphere MQ for AIX, MQSeries for OS/2 Warp, and WebSphere MQ for Windows
Visual Basic samples for WebSphere MQ for Windows
Samples for WebSphere MQ for iSeries
Samples for MQSeries for Compaq NonStop Kernel
Samples for MQSeries for VSE/ESA

Samples for Compaq OpenVMS Alpha and UNIX systems

Table 32 shows the techniques demonstrated by the sample programs for WebSphere MQ on UNIX systems and WebSphere MQ for Digital OpenVMS.

Table 32. WebSphere MQ on UNIX and Compaq OpenVMS Alpha sample programs demonstrating use of the MQI

Technique C
(source) (1)
COBOL
(source) (2)
C
(executable)
Client (3) (executable)
Putting messages using the MQPUT call amqsput0
amqsputw (4)
amq0put0 amqsput amqsputc amqsputw
Putting a single message using the MQPUT1 call amqsinqa amqsecha amqminqx amqmechx amqiinqx amqiechx amqvinqx amqviechx amqsinq amqsech amqsechc
Putting messages to a distribution list (5) amqsptl0 no sample amqsptl amqsptlc
Replying to a request message
amqsinq0
amqsinqa
amqminqx
amqiinqx
amqvinqx
amqsinq
no sample
Getting messages (no wait)
amqsgbr0
amq0gbr0
amqsgbr
no sample
Getting messages (wait with a time limit)
amqsget0
amqsgetw (4)
amq0get0
amqsget
amqsgetc
amqsgetw
Getting messages (unlimited wait)
amqstrg0
no sample
amqstrg
amqstrgc
Getting messages (with data conversion)
amqsecha
no sample
amqsech
no sample
Putting Reference Messages to a queue (5) amqsprma
no sample
amqsprm
amqsprmc
Getting Reference Messages from a queue (5) amqsgrma
no sample
amqsgrm
amqsgrmc
Reference Message channel exit (5) amqsqrma
amqsxrma
no sample
amqsxrm
no sample
Browsing first 20 characters of a message
amqsgbr0
amq0gbr0
amqsgbr
amqsgbrc
Browsing complete messages
amqsbcg0
no sample
amqsbcg
amqsbcgc
Using a shared input queue (4) amqsinq0
amqminqx
amqiinqx
amqvinqx
amqsinq
amqsinqc
Using an exclusive input queue
amqstrg0
amq0req0
amqstrg
amqstrgc
Using the MQINQ call
amqsinqa
amqminqx
amqiinqx
amqvinqx
amqsinq
no sample
Using the MQSET call
amqsseta
amqmsetx
amqisetx
amqvsetx
amqsset
amqssetc
Using a reply-to queue
amqsreq0
amq0req0
amqsreq
amqsreqc
Requesting message exceptions
amqsreq0
amq0req0
amqsreq
no sample
Accepting a truncated message
amqsgbr0
amq0gbr0
amqsgbr
no sample
Using a resolved queue name
amqsgbr0
amq0gbr0
amqsgbr
no sample
Triggering a process
amqstrg0
no sample
amqstrg
amqstrgc
Using data conversion
(6) no sample
no sample
no sample
WebSphere MQ (coordinating XA-compliant
database managers) accessing a single
database using SQL
amqsxas0.sqc
amq0xas0.sqb
no sample
no sample
WebSphere MQ (coordinating XA-compliant
database managers) accessing two
databases using SQL
amqsxag0.c
amqsxab0.sqc
amqsxaf0.sqc
amq0xag0.cbl
amq0xab0.sqb
amq0xaf0.sqb
no sample
no sample
CICS transaction (7) amqscic0.ccs
no sample
amqscic0
no sample
Encina transaction (5) amqsxae0
no sample
amqsxae0
no sample
TUXEDO transaction to put messages (8) amqstxpx
no sample
no sample
no sample
TUXEDO transaction to get messages (8) amqstxgx
no sample
no sample
no sample
Server for TUXEDO (8) amqstxsx
no sample
no sample
no sample
Dead-letter queue handler
(9) no sample
amqsdlq
no sample
From an MQI client, putting a message (4) amqsputw
no sample
no sample
amqsputc
amqsputw
From an MQI client, getting a message (4) amqsgetw
no sample
no sample
amqsgetc
amqsgetw
Connecting to the queue manager
using MQCONNX
amqscnxc
no sample
no sample
amqscnxc
Using API exits (10)
amqsaxe0.c
no sample
amqsaxe
no sample
Cluster workload balancing exit
amqswlm0.c
no sample
amqswlm
no sample
Notes:
  1. The executable version of the WebSphere MQ client samples share the same source as the samples that run in a server environment.
  2. COBOL is not supported by MQSeries for AT&T GIS UNIX. Compile programs beginning 'amqm' with the Micro Focus COBOL compiler, those beginning 'amqi' with the IBM COBOL compiler, and those beginning 'amq0' with either.
  3. The executable versions of the WebSphere MQ client samples are not available on WebSphere MQ for HP-UX or MQSeries for Compaq OpenVMS Alpha.
  4. Not available on MQSeries for Compaq Tru64 UNIX.
  5. Supported on WebSphere MQ for AIX, WebSphere MQ for HP-UX, and WebSphere MQ for Solaris only.
  6. On WebSphere MQ for AIX, WebSphere MQ for HP-UX, MQSeries for DIGITAL UNIX (Compaq Tru64 UNIX), and WebSphere MQ for Solaris this program is called amqsvfc0.c. On MQSeries for AT&T GIS UNIX, MQSeries for Compaq OpenVMS Alpha, and MQSeries for SINIX and DC/OSx this program is called amqsvfcx.c.
  7. CICS is supported by WebSphere MQ for AIX and WebSphere MQ for HP-UX only.
  8. TUXEDO is not supported by WebSphere MQ for iSeries or MQSeries for Compaq OpenVMS Alpha.
  9. The source for the dead-letter queue handler is made up of several files and provided in a separate directory.
  10. The API exit function is only available on WebSphere MQ platforms from V5.3.

Samples for MQSeries for OS/2 Warp and WebSphere MQ for Windows

Table 33 shows the techniques demonstrated by the sample programs for MQSeries for OS/2 Warp and WebSphere MQ for Windows.

Table 33. MQSeries for OS/2 Warp and WebSphere MQ for Windows sample programs demonstrating use of the MQI

Technique C (source) COBOL (source) C (executable) Client (executable)
Putting messages using the MQPUT call amqsput0 amq0put0 amqsput amqsputc amqsputw
Putting a single message using the
MQPUT1 call
amqsinqa amqsecha amqminq2 amqmech2 amqiinq2 amqiech2 amqsinq amqsech amqsinqc amqsechc
Putting messages to a distribution list amqsptl0 no sample amqsptl amqsptlc
Replying to a request message amqsinq0 amqminq2 amqiinq2 amqsinq amqsinqc
Getting messages (no wait) amqsgbr0 amq0gbr0 amqsgbr amqsgbrc
Getting messages (wait with a time limit) amqsget0 amqsgetw amq0get0 amqsget amqsgetc amqsgetw
Getting messages (unlimited wait) amqstrg0 no sample amqstrg amqstrgc
Getting messages (with data conversion) amqsecha no sample amqsech amqsechc
Putting Reference Messages to a queue amqsprma no sample amqsprm amqsprmc
Getting Reference Messages from a queue amqsgrma no sample amqsgrm amqsgrmc
Reference Message channel exit amqsqrma amqsxrma no sample amqsxrm no sample
Browsing first 20 characters of a message amqsgbr0 amq0gbr0 amqsgbr amqsgbrc
Browsing complete messages amqsbcg0 no sample amqsbcg amqsbcgc
Using a shared input queue amqsinq0 amqminq2 amqiinq2 amqsinq amqsinqc
Using an exclusive input queue amqstrg0 amq0req0 amqstrg amqstrgc
Using the MQINQ call amqsinqa amqminq2 amqiinq2 amqsinq amqsinqc
Using the MQSET call amqsseta amqmset2 amqiset2 amqsset amqssetc
Using a reply-to queue amqsreq0 amq0req0 amqsreq amqsreqc
Requesting message exceptions amqsreq0 amq0req0 amqsreq amqsreqc
Accepting a truncated message amqsgbr0 amq0gbr0 amqsgbr amqsgbrc
Using a resolved queue name amqsgbr0 amq0gbr0 amqsgbr amqsgbrc
Triggering a process amqstrg0 no sample amqstrg amqstrgc
Using data conversion amqsvfc0 no sample no sample no sample
CICS transaction amqscic0.ccs no sample amqscic0 (1) no sample
TUXEDO transaction to put messages
(Windows systems only)
amqstxpx no sample no sample no sample
TUXEDO transaction to get messages
(Windows systems only)
amqstxgx no sample no sample no sample
Server for TUXEDO
(Windows systems only)
amqstxsx no sample no sample no sample
Encina transaction amqsxae0 no sample amqsxae0 no sample
Dead-letter queue handler (2) no sample amqsdlq no sample
From a WebSphere MQ client, putting a message amqsputw no sample no sample amqsputc amqsputw
From a WebSphere MQ client, getting a message amqsgetw no sample no sample amqsgetc amqsgetw
Connecting to the queue manager using MQCONNX amqscnxc no sample no sample amqscnxc
Using API exits (3)
amqsaxe0
no sample
amqsaxe
no sample
Cluster workload balancing
amqswlm0
no sample
amqswlm
no sample
SSPI security routines (4)
amqsspin
no sample
amqrspin.dll
amqrspin.dll
Notes:
  1. The executable version on OS/2 is for CICS Transaction Server for OS/2, Version 4; the version on Windows systems is for TXSeries for Windows NT, Version 4.
  2. The source for the dead-letter queue handler is made up of several files and provided in a separate directory.
  3. Only available for WebSphere MQ from V5.3.
  4. Only available for WebSphere MQ for Windows.

PL/I samples for WebSphere MQ for AIX, MQSeries for OS/2 Warp, and WebSphere MQ for Windows

Table 34 shows the techniques demonstrated by the WebSphere MQ for AIX, MQSeries for OS/2 Warp, and WebSphere MQ for Windows sample programs.

Table 34. WebSphere MQ for AIX, MQSeries for OS/2 Warp and WebSphere MQ for Windows sample programs demonstrating use of the MQI

Technique PL/I (source) PL/I (executable)
Putting messages using the MQPUT call amqpput0 no sample
Getting messages (wait with a time limit) amqpget0 no sample

Visual Basic samples for WebSphere MQ for Windows

Table 35 shows the techniques demonstrated by the WebSphere MQ for Windows sample programs.

A project may contain several files. When you open a project within Visual Basic the other files will be loaded automatically. No executable programs are provided.

All the sample projects, except mqtrivc.vbp, are set up to work with the WebSphere MQ server. To find out how to change the sample projects to work with the WebSphere MQ clients see Preparing Visual Basic programs.

Table 35. WebSphere MQ for Windows sample programs demonstrating use of the MQI

Technique Project file name
Putting messages using the MQPUT call amqsputb.vbp
Getting messages using the MQGET call amqsgetb.vbp
Browsing a queue using the MQGET call amqsbcgb.vbp
Simple MQGET and MQPUT sample (client) mqtrivc.vbp
Simple MQGET and MQPUT sample (server) mqtrivs.vbp
Putting and getting strings and user-defined structures using MQPUT and MQGET strings.vbp
Using PCF structures to start and stop a channel pcfsamp.vbp
Creating a queue using the MQAI amqsaicq.vbp
Listing a queue manager's queues using the MQAI amqsailq.vbp
Monitoring events using the MQAI amqsaiem.vbp

Samples for WebSphere MQ for iSeries

Table 36 shows the techniques demonstrated by the WebSphere MQ for iSeries sample programs. Some techniques occur in more than one sample program, but only one program is listed in the table.

Table 36. WebSphere MQ for iSeries sample programs demonstrating use of the MQI

Technique C
(source) (1)
COBOL
(source) (2)
RPG
(source) (3)
Putting messages using the MQPUT call AMQSPUT0 AMQ0PUT4 AMQnPUT4
Putting messages from a data file using the MQPUT call AMQSPUT4 no sample no sample
Putting a single message using the MQPUT1 call AMQSINQ4, AMQSECH4 AMQ0INQ4, AMQ0ECH4 AMQnINQ4, AMQnECH4
Putting messages to a distribution list AMQSPTL4 no sample no sample
Replying to a request message AMQSINQ4 AMQ0INQ4 AMQnINQ4
Getting messages (no wait) AMQSGBR4 AMQ0GBR4 AMQnGBR4
Getting messages (wait with a time limit) AMQSGET4 AMQ0GET4 AMQnGET4
Getting messages (unlimited wait) AMQSTRG4 no sample AMQ3TRG4
Getting messages (with data conversion) AMQSECH4 AMQ0ECH4 AMQnECH4
Putting Reference Messages to a queue AMQSPRM4 no sample no sample
Getting Reference Messages from a queue AMQSGRM4 no sample no sample
Reference Message channel exit AMQSQRM4, AMQSXRM4 no sample no sample
Message exit AMQSCMX4 no sample no sample
Browsing first 49 characters of a message AMQSGBR4 AMQ0GBR4 AMQnGBR4
Browsing complete messages AMQSBCG4 no sample no sample
Using a shared input queue AMQSINQ4 AMQ0INQ4 AMQnINQ4
Using an exclusive input queue AMQSREQ4 AMQ0REQ4 AMQnREQ4
Using the MQINQ call AMQSINQ4 AMQ0INQ4 AMQnINQ4
Using the MQSET call AMQSSET4 AMQ0SET4 AMQnSET4
Using a reply-to queue AMQSREQ4 AMQ0REQ4 AMQnREQ4
Requesting message exceptions AMQSREQ4 AMQ0REQ4 AMQnREQ4
Accepting a truncated message AMQSGBR4 AMQ0GBR4 AMQnGBR4
Using a resolved queue name AMQSGBR4 AMQ0GBR4 AMQnGBR4
Triggering a process AMQSTRG4 no sample AMQ3TRG4
Trigger server AMQSERV4 no sample AMQ3SRV4
Using a trigger server (including CICS transactions) AMQSERV4 no sample AMQ3SRV4
Using data conversion AMQSVFC4 no sample no sample
Using API exits
AMQSAXE0
no sample
no sample
Cluster workload balancing
AMQSWLM0
no sample
no sample
Notes:
  1. Source for the C samples is in the file QMQMSAMP/QCSRC. Include files exist as members in the file QMQM/H.
  2. Source for the COBOL samples are in the files QMQMSAMP/QCBLSRC for the OPM compiler, and QMQMSAMP/QCBLLESRC for the ILE compiler. The members are named AMQ0xxx4, where xxx indicates the sample function.
  3. There are three sets of RPG sample programs:
    1. OPM RPG programs.

      The source is in QMQMSAMP/QRPGSRC. Members are named AMQ1xxx4, where xxx indicates the sample function. Copy members exist in QMQM/QRPGSRC.

    2. ILE RPG programs using the MQI through a call to QMQM.

      The source is in QMQMSAMP/QRPGLESRC. Members are named AMQ2xxx4, where xxx indicates the sample function. Copy members exist in QMQM/QRPGLESRC. Each member name has the suffix "R".

    3. ILE RPG programs using prototyped calls to the MQI.

      The source is in QMQMSAMP/QRPGLESRC. Members are named AMQ3xxx4, where xxx indicates the sample function. Copy members exist in QMQM/QRPGLESRC. Each member name has the suffix "G".

In addition to these, the WebSphere MQ for iSeries sample option includes a sample data file, which can be used as input to the sample programs, AMQSDATA and sample CL programs that demonstrate administration tasks. The CL samples are described in WebSphere MQ for iSeries V5.3 System Administration. You could use the sample CL program amqsamp4 to create queues to use with the sample programs described in this chapter.

Samples for MQSeries for Compaq NonStop Kernel

The following C and COBOL sample programs are supplied with MQSeries for Compaq NonStop Kernel:


Table 37. MQSeries for Compaq NonStop Kernel C and COBOL sample programs demonstrating use of the MQI

Description
C
(source)
C
(executable)
COBOL85
(source)
COBOL85
(executable)
Putting messages using
the MQPUT call
amqsput0
amqsput
amq0put0
amq0put
Putting a single message
using the MQPUT1 call
amqsinqa
amqsinq
No sample
No sample
Getting messages
(no wait)
amqsgbr0
amqsgbr
amq0gbr0
amq0gbr
Getting messages
(wait with a time limit)
amqsget0
amqsget
amq0get0
amq0get
Getting messages
(unlimited wait)
amqstrg0
amqstrg
No sample
No sample
Getting messages
(with data conversion)
amqsecha
amqsech
amq0ech0
amq0ech
Browsing complete messages
amqsbcg0
amqsbcg
No sample
No sample
Use a shared input queue
No sample
No sample
amq0inq0
amq0inq
Using the MQSET call
amqsseta
amqsset
amq0set0
amq0set
Using a reply-to queue
amqsreq0
amqsreq
amq0req0
amq0req
Using data conversion
amqsvfcn
No sample
No sample
No sample
Sample skeleton for channel exit
amqsvchn
No sample
No sample
No sample

The following TAL sample programs are supplied with MQSeries for Compaq NonStop Kernel:

Table 38. MQSeries for Compaq NonStop Kernel TAL sample programs demonstrating use of the MQI

Description
TAL
(source)
TAL
(executable)
Read n messages from a queue
zmqreadt
zmqread
Write n messages of n length to a queue
zmqwritt
zmqwrit

Samples for MQSeries for VSE/ESA

Table 39 shows the techniques demonstrated by the MQSeries for VSE/ESA COBOL sample programs.

Table 39. MQSeries for VSE/ESA COBOL sample programs demonstrating use of the MQI

Description
COBOL
(source)
COBOL
(executable)
Transaction that demonstrates MQI calls (1) TTPTST2.Z
TTPTST2
Test facility that starts the sample
transaction TTPTST2 (2)
TTPTST3.Z
TTPTST3
Triggered test program that echoes a
message from a queue to a reply-to queue
MQPECHO.Z
MQPECHO
Notes:
  1. Demonstrates MQGET, MQINQ, MQPUT, MQPUT1, both MQPUT and MQGET, MQGET and delete, MQPUT and reply.
  2. Each TTPTST2 that is started is a task.



© IBM Corporation 1993, 2002. All Rights Reserved