Running the sample programs

Before you can run any of the sample programs, create a queue manager and set up the default definitions. This is explained in WebSphere MQ System Administration Guide.

On all platforms except i5/OS

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(R) systems, enter:

Check the sampobj.out file to ensure that there are no errors.

To do this on Windows systems enter:

Check the sampobj.out file to ensure that there are no errors. This file is in your current directory.

You can now run the sample applications. Enter the name of the sample application followed by any parameters, for example:

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.

On i5/OS

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.

Note:
For a compiled module to use the IFS file system, specify the option SYSIFCOPT(*IFSIO) on CRTCMOD, then the file name, passed as a parameter, must be specified in the following format:
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. If you want the COBOL versions you must change the process definitions:

On 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 i5/OS, you can use the CHGMQMPRC command (described in the WebSphere MQ for iSeries V6 System Administration Guide), or edit and run AMQSAMP4 with the alternative definition.