These examples are based on a Linux system. Switch to the mqm user.
su - mqm
The amqsget command can be used to GET the messages in a queue. In this example, there is one message in QUEUE01, and the message contains the text Hello World. Be aware that this will remove the message from the local queue, as this is a GET operation. If you are unsure of the <mq install> directory, use the dspmqinst command.
<mq install>/samp/bin/amqsget QUEUE01 MANAGER01 Sample AMQSGET0 start message <Hello World> Sample AMQSGET0 end
If there are no messages in the queue, the following will be displayed.
<mq install>/samp/bin/amqsget QUEUE01 MANAGER01 Sample AMQSGET0 start no more messages Sample AMQSGET0 end