Running the sample programs
Consider using this topic when running sample programs across different platforms.
Before you can run any of the sample programs, create a queue manager and set up the default definitions. This is explained in Administering.
On Windows, UNIX and Linux platforms
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.
runmqsc QManagerName <amqscos0.tst >/tmp/sampobj.out
sampobj.out
file to ensure that there are no errors.
runmqsc QManagerName <amqscos0.tst > sampobj.out
sampobj.out
file to ensure that there are no errors. This file is in your current directory.
amqsput myqueue qmanagername
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.
On IBM i
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.
CALL PGM(QMQM/AMQSPUT4) PARM('QMQMSAMP/AMQSDATA(PUT)')
The sample data only applies to the C/400® sample programs.
home/me/myfile
Length of queue name
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.
Inquire, Set, and Echo examples
For the Inquire, Set, and Echo examples, the sample definitions trigger the C versions of these samples.
- SYSTEM.SAMPLE.INQPROCESS
- SYSTEM.SAMPLE.SETPROCESS
- SYSTEM.SAMPLE.ECHOPROCESS
On Windows, UNIX and Linux systems 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, as shown previously.
On IBM® i, you can use the CHGMQMPRC command (for details, see Change MQ Process (CHGMQMPRC) ), or edit and run the AMQSAMP4 command with the alternative definition.