The following sections help you find the samples that you need to run on the different platforms.
The source for WebSphere MQ for iSeries sample programs are provided in library QMQMSAMP as members of QCSRC, QCLSRC, QCBLSRC, QCBLLESRC, QRPGSRC, and QRPGLESRC. To run the samples use either the C executable versions, supplied in the library QMQM, or compile them as you would any other WebSphere MQ application. For more information see Running the sample programs.
Table 40. Where to find the samples for WebSphere MQ on UNIX systems
Content | Directory |
---|---|
source files | /mqmtop/samp |
C source file for Windows 3.1 sample | /mqmtop/win_client/samp |
dead-letter queue handler source files | /mqmtop/samp/dlq |
executable files | /mqmtop/samp/bin |
Other WebSphere MQ client executable files | /mqmtop/dos_client/samp/bin /mqmtop/os2_client/samp/bin /mqmtop/win_client/samp/bin |
|
The WebSphere MQ on UNIX systems sample files will be in the directories listed in Table 40 if the defaults were used at installation time. To run the samples, either use the executable versions supplied or compile the source versions as you would any other applications, using an ANSI compiler. For information on how to do this, see Running the sample programs.
Table 41. Where to find the samples for MQSeries for Compaq OpenVMS Alpha
Content | Directory |
---|---|
source files | MQS_EXAMPLES |
C source file for Windows 3.1 sample | [.WIN_CLIENT.SAMP] under MQS_EXAMPLES |
dead-letter queue handler source files | [.DLQ] under MQS_EXAMPLES |
executable files | [.BIN] under MQS_EXAMPLES |
Other WebSphere MQ client executable files | [.DOS_CLIENT.SAMP.BIN] under MQS_EXAMPLES [OS2_CLIENT.SAMP.BIN] under MQS_EXAMPLES [WIN_CLIENT.SAMP.BIN] under MQS_EXAMPLES |
The MQSeries for Compaq OpenVMS Alpha sample files are in the directories listed in Table 41 if the defaults were used at installation time. To run the samples, either use the executable versions supplied or compile the source versions as you would any other applications, using an ANSI compiler. For information on how to do this, see Running the sample programs.
Table 42. Where to find the samples for MQSeries for OS/2 Warp and WebSphere MQ for Windows
Content |
Directory |
---|---|
C source code |
<drive:directory>\MQM\TOOLS\C\SAMPLES <drive:directory>\Program Files\IBM\WebSphere MQ\ Tools\C\Samples |
Source code for dead-letter handler sample |
<drive:directory>\MQM\TOOLS\C\SAMPLES\DLQ <drive:directory>\Program Files\IBM\WebSphere MQ\ Tools\C\Samples\DLQ |
C source code for Windows 3.1 sample |
<drive:directory>\MQM\WIN |
COBOL source code |
<drive:directory>\MQM\TOOLS\COBOL\SAMPLES <drive:directory>\Program Files\IBM\WebSphere MQ\ Tools\Cobol\Samples |
C executable files |
<drive:directory>\MQM\TOOLS\C\SAMPLES\BIN <drive:directory>\Program Files\IBM\WebSphere MQ\ Tools\C\Samples\Bin |
Other WebSphere MQ client executable files |
<drive:directory>\MQM\DOS <drive:directory>\MQM\AIX <drive:directory>\MQM\WIN |
Sample MQSC files |
<drive:directory>\MQM\TOOLS\MQSC\SAMPLES <drive:directory>\Program Files\IBM\WebSphere MQ\ Tools\MQSC\Samples |
PL/I source code |
<drive:directory>\MQM\TOOLS\PLI\SAMPLES <drive:directory>\Program Files\IBM\WebSphere MQ\ Tools\PLI\Samples |
Visual Basic Version 6 source code |
<drive:directory>\Program Files\IBM\WebSphere MQ\ Tools\VB\SampVB6 |
Notes:
|
The MQSeries for OS/2 Warp and WebSphere MQ for Windows sample files will be in the directories listed in Table 42 if the defaults were used at installation time, the <drive:directory> will default to <c:>. To run the samples, either use the executable versions supplied or compile the source versions as you would any other MQSeries for OS/2 Warp or WebSphere MQ for Windows applications. For information on how to do this, see Running the sample programs.
The subvolume ZMQSSMPL contains the following TACL macro files to be used for building non-native sample C applications:
This is a basic macro for compiling a C source file using the include files contained in subvolume ZMQSLIB. For example, to compile the sample AMQSBCG0, use CSAMP AMQSBCG0. If the compilation is successful, the macro produces an object file with the last character of the file name replaced by the letter "O"; for example, AMQSBCGO.
This is a basic macro used to bind an object file with the user libraries in ZMQSLIB. For example, to bind the compiled sample AMQSBCG0, use BSAMP AMQSBCG. The macro produces an executable file called exe-file-nameE; for example, AMQSBCGE.
This TACL macro compiles each of the sample source code files using the CSAMP macro.
This TACL macro binds each of the sample object files into executables using the BSAMP macro.
This TACL macro compiles and binds all of the C sample files using the macros COMPALL and BINDALL.
For a native install, the following TACL macro files are to be used for building sample MQI applications:
Macro to compile all samples native using NMCSAMP.
Macro to compile user code for inclusion in the MQSeries for Compaq NonStop Kernel PSRL.
This is a basic macro for compiling a C source file using the include files contained in subvolume ZMQSLIB. For example, to compile the sample AMQSBCG0, use NMCSAMP AMQSBCG0. If the compilation is successful, the macro produces an object file with the last character of the file name replaced by the letter "O"; for example, AMQSBCGO.
This basic macro links an object file with the static MQI library in ZMQSLIB.
This basic macro links an object file with the MQSeries for Compaq NonStop Kernelprivate SRL in ZMQSLIB
This is a basic macro for linking user code into a relinkable library.
The subvolume ZMQSSMPL contains the following files to be used for building sample COBOL applications.
This is a basic macro for compiling a COBOL source file using the definition files contained in subvolume ZMQSLIB. For example, to compile the program AMQ0GBR0, use COBSAMP AMQ0GBR0. If the compilation is successful, the macro produces an object file with the last character of the file name replaced by the letter "O"; for example, AMQ0GBRO.
This is a basic macro used to bind an object with the user libraries in ZMQSLIB. For example, to bind the compiled sample AMQ0GBRO, use BCOBSAMP AMQ0GBR. The macro produces an executable called exe-file-name AMQ0GBR.
This TACL macro compiles each of the COBOL sample source code files.
This bind input file binds each of the COBOL sample object files into executables.
This TACL macro compiles and binds all of the COBOL sample files using the macros CCBSMPLS and BCBSMPLS.
The subvolume ZMQSSMPL contains the following files to be used for building sample TAL programs.
This is a basic macro for compiling a TAL source file using the definition files contained in subvolume ZMQSLIB. For example, to compile the program ZMQWRITT, use TALSAMP ZMQWRITT. If the compilation is successful, the macro produces an object file with the last character of the file name replaced by the letter "O"; for example, ZMQWRITO.
This is a basic macro used to bind an object with the user libraries in ZMQSLIB. For example, to bind the compiled sample ZMQWRITO, use BTALSAMP ZMQWRIT.
This TACL macro compiles each of the TAL sample source code files.
This bind input file binds each of the TAL sample object files into executables.
This TACL macro compiles and binds all of the TAL sample files using the macros CTLSMPLS and BTLSMPLS.
Before you can run any of the sample programs, a queue manager must be created and the default definitions set up. This is explained in WebSphere MQ System Administration Guide for WebSphere MQ for AIX, WebSphere MQ for Linux for Intel and Linux for zSeries, WebSphere MQ for HP-UX, MQSeries for OS/2 Warp, WebSphere MQ for Solaris, and WebSphere MQ for Windows; for other platforms, see the appropriate System Management Guide.
The samples need a set of queues to work with. Either use your own queues or run the sample MQSC file amqscos0.tst to create a set.
To do this on UNIX systems and Compaq OpenVMS Alpha, enter:
runmqsc QManagerName <amqscos0.tst >/tmp/sampobj.out
Check the sampobj.out file to ensure that there are no errors.
To do this on OS/2 and Windows systems enter:
runmqsc QManagerName <amqscos0.tst > sampobj.out
Check the sampobj.out file to ensure that there are no errors. This file is in your current directory.
To do this on Compaq NonStop Kernel enter:
runmqsc -i $SYSTEM.ZMQSSMPL.AMQSCOMA
Check the sampobj.out file to ensure that there are no errors. This file will be found in your current directory.
The sample applications can now be run. Enter the name of the sample application followed by any parameters, for example:
amqsput myqueue qmanagername
where myqueue is the name of the queue on which the messages are going to be put, and qmanagername is the queue manager that owns myqueue.
See the description of the individual samples for information on the parameters that each of them expects.
You can use your own queues when you run the samples, or you can run the sample program AMQSAMP4 to create some sample queues. The source for this program is shipped in file QCLSRC in library QMQMSAMP. It can be compiled using the CRTCLPGM command.
To call one of the sample programs using data from member PUT in file AMQSDATA of library QMQMSAMP, use a command like:
CALL PGM(QMQM/AMQSPUT4) PARM('QMQMSAMP/AMQSDATA(PUT)')
The sample data only applies to the C/400(R) sample programs.
home/me/myfile
For the COBOL sample programs, when you pass queue names as parameters, you must provide 48 characters, padding with blank characters if necessary. Anything other than 48 characters causes the program to fail with reason code 2085.
For the Inquire, Set, and Echo examples, the sample definitions cause the C versions of these samples to be triggered. If you want the COBOL versions you must change the process definitions:
SYSTEM.SAMPLE.INQPROCESS
SYSTEM.SAMPLE.SETPROCESS
SYSTEM.SAMPLE.ECHOPROCESS
On OS/2, Windows systems and UNIX do this by editing the amqscos0.tst file and changing the C executable file names to the COBOL executable file names before using the runmqsc command above.
On OS/400, you can use the CHGMQMPRC command (described in WebSphere MQ for iSeries V5.3 System Administration), or edit and run AMQSAMP4 with the alternative definition.