Running the Put sample programs
Running the amqsput and amqsputc samples
- The name of the target queue (required)
- The name of the queue manager (optional)
If a queue manager is not specified, amqsput connects to the default queue manager and amqsputc connects to the queue manager identified by an environment variable or the client channel definition file.
- The open options (optional)
If open options are not specified, the sample uses a value of 8208 which is the combination of these two options:
- The close options (optional)
If close options are not specified, the sample uses a value of 0 which is MQCO_NONE.
- The name of the target queue manager (optional)
If a target queue manager is not specified, the
ObjectQMgrNamefield in the MQOD will be left blank.
- The name of the dynamic queue (optional)
If a dynamic queue name is not specified, the
DynamicQNamefield in the MQOD will be left blank.
These programs also use an environment variable named MQSAMP_USER_ID which should be set to the user ID to be used for connection authentication. When this is set, the program will prompt for a password to accompany that user ID.
amqsput myqueue qmanagername
amqsputc myqueue qmanagername
myqueueis the name of the queue on which the messages are going to be put, and
qmanagernameis the queue manager that owns
Running the amq0put sample
Please enter the name of the target queue
It takes input from StdIn and adds each line of input to the target queue. A blank line indicates there is no more data.
Running the AMQSPUT4 C sample ( IBM i)
The C program AMQSPUT4, available only for the IBM® i platform, creates messages by reading data from a member of a source file.
queue name text of message 1 text of message 2 ⋮ text of message n blank line
A sample of input for the put samples is supplied in library QMQMSAMP file AMQSDATA member PUT.
The C program puts messages on the queue named in the first line of the file; you can use the supplied queue SYSTEM.SAMPLE.LOCAL. The program puts the text of each of the following lines of the file into separate datagram messages, and stops when it reads a blank line at the end of the file.
CALL PGM(QMQM/AMQSPUT4) PARM('QMQMSAMP/AMQSDATA(PUT)')
Running the AMQ0PUT4 COBOL sample ( IBM i)
The COBOL program AMQ0PUT4, available only on the IBM i platform, creates messages by accepting data from the keyboard.
To start the program, call the program and give the name of your target queue as a program parameter. The program accepts input from the keyboard into a buffer and creates a datagram message for each line of text. The program stops when you enter a blank line at the keyboard.