
Before copying messages on a queue to a file, you may want to use the amqsbcg command to view the messages in the queue.
The dmpmqmsg command with the -i (input queue) option can be used to copy messages in a queue to a file. In this example, the messages in the queue named QUEUE01 on the queue manager named MANAGER01 are copied to file.txt. This will not remove the messages off the queue. The amqsget command can be used to GET the messages off the queue or the clear qlocal command can be used to purge the messages from the queue.
~]# dmpmqmsg -m MANAGER01 -i QUEUE01 -f /path/to/file.txt
IBM MQ Queue Load/Unload Utility
Read - Files: 0 Messages:1 Bytes:181
Written - Files: 1 Messages:1 Bytes:181
The dmpmqmsg command with the -o (output queue) option can be used to copy messages from a file to a queue, to PUT the messages on the queue. In this example, the messages in file.txt will be put onto QUEUE01.
dmpmqmsg -m MANAGER01 -o QUEUE01 -f /path/to/file.txt
IBM MQ Queue Load/Unload Utility
Read - Files:1 Messages:1 Bytes:181
Written - Files:0 Messages:1 Bytes:181
Did you find this article helpful?
If so, consider buying me a coffee over at