Example of using the qload utility (SupportPac MO03: WebSphere MQ Queue Load / Unload Utility)

Technote (troubleshooting)


Problem(Abstract)

You want to see a detailed example of using the qload utility, provided with the SupportPac MO03: WebSphere MQ Queue Load / Unload Utility

Resolving the problem


+++ Note for MQ 8.0:
The new command "dmpmqmsg" was introduced in MQ 8.0 and it is based on the "qload" utility.

+++ Here are the details of the full scenario that shows how to use the utility.

You have a queue manager in Linux that has messages in a queue (Q1) that you want to move into another queue (Q2) in the same queue manager. You want to install the qload utility in a Windows box.

Setup for test. Queue (Q1) has 4 messages which were already added by using the sample "amqsput" (local queue manager) or "amqsputc" (remote queue manager)

Linux box:

display ql(Q1) CURDEPTH
     2 : display ql(Q1) CURDEPTH
AMQ8409: Display Queue details.
   QUEUE(Q1)                               TYPE(QLOCAL)
   CURDEPTH(4)

Windows box:

MO03: WebSphere MQ Queue Load / Unload Utility

Download the pdf and zip file into Windows, such as:
C:\MQ-SupportPac\MO03 Queue Load - Unload

Unzip.
Cd to the Windows subdirectory of the unzipped files.
  cd C:\MQ-SupportPac\MO03 Queue Load - Unload\Windows

Set the MQSERVER environment variable to point to the queue manager in Linux.
In this example, it is:
set MQSERVER=SYSTEM.DEF.SVRCONN/TCP/veracruz.x.com(1414)

Run qload to read from the queue, Q1, and store the output in c:\temp\mqload.txt. Connect as a remote client (this is the attribute: -l mqic32) to the queue manager QM_VER running in the Linux host and port established by MQSERVER:

C:\MQ-SupportPac\MO03 Queue Load - Unload\Windows>
qload -m QM_VER -i Q1 -f c:\temp\mqqload.txt -l mqic32
QLOAD Program by Paul Clarke [ V1.6 Build:Jul 15 2008 ]
Read    - Files:   0  Messages:     4  Bytes:        22
Written - Files:   1  Messages:     4  Bytes:        22

The output file c:\temp\mqqload.txt will have text, using a format that qload understands.

Windows box:

Issue qlocal to load queue (Q2) on Linux from a file on Windows (use -o instead of -i):

qload -m QM_VER -o Q2 -f c:\temp\mqqload.txt -l mqic32
QLOAD Program by Paul Clarke [ V1.6 Build:Jul 15 2008 ]
Read    - Files:   1  Messages:     4  Bytes:        22
Written - Files:   0  Messages:     4  Bytes:        22

Linux box:

Notice that there are now 4 messages in the queue (restored from the file).
display ql(Q2) CURDEPTH
     6 : display ql(Q2) CURDEPTH
AMQ8409: Display Queue details.
   QUEUE(Q2)                               TYPE(QLOCAL)
   CURDEPTH(4)

Linux box:

Delete the messages from the original queue.
clear qlocal(Q1)
     4 : clear qlocal(Q1)
AMQ8022: WebSphere MQ queue cleared.

Confirming that there are no more messages:
display ql(Q1) CURDEPTH
     5 : display ql(Q1) CURDEPTH
AMQ8409: Display Queue details.
   QUEUE(Q1)                               TYPE(QLOCAL)
   CURDEPTH(0)


+++ SupportPac MO03 is Category 2 (not supported by MQ Support)

Technical support
Category 2 SupportPacs are provided in good faith and AS-IS. There is no warranty or further service implied or committed and any supplied sample code is not supported via IBM product service channels.

Product Alias/Synonym

WMQ MQ MQSeries

Rate this page:

(0 users)Average rating

Document information


More support for:

WebSphere MQ
Capability

Software version:

6.0, 7.0, 7.1, 7.5, 8.0

Operating system(s):

AIX, HP-UX, Linux, Solaris, Windows

Reference #:

1585718

Modified date:

2014-07-30

Translate my page

Machine Translation

Content navigation