Loading files to multiple queues

If you have unloaded MQ message data in a file that you need to load onto a queue, you can use QLOAD with an invocation something like this:

qload -m MQG1 -o Q1 -f msgtext.qld

If you have files containing message data that wasn’t written by QLOAD, you can still load it up again with QLOAD. See QLOAD: Using delimited files. The mechanisms in this blog post can also be combined with those types of message data files.

Since QLOAD V8.0.2 you have also been able to load a file up onto multiple queues like this:

qload -m MQG1 -o Q1 -o Q2 -o Q3 -o Q4 -f msgtext.qld

In other words you can repeat the -o parameter as often as required. This operation will make use of distribution lists in IBM MQ unless you force the use of individual MQOPENs with the -OI flag. When running QLOAD on z/OS, this latter mechanism is always used.

The queue names specified on the -o parameters can be fully qualified destinations, for example MQG2/Q1, that is Q1 on queue manager MQG2.

If you have quite a lot of queues and you don’t want to specify lots of -o parameters, you can instead put the list of queue names into a destination file and tell QLOAD to use that, with an invocation something like this:

qload -m MQG1 -o file:mydestinations.dst -f msgtext.qld

Your destination file might look something like this, illustrating comment lines and the fact that you can also include other destination files:

* This file contains queue destinations used by QLOAD
MQG1/Q1
MQG2/Q1
MQG3/Q1

* You can even load other files
file:moredestinations.dst

mydestinations.dst

If you’re running QLOAD on z/OS, you could make use of an inline DD card to keep all the listed queue names in a single piece of JCL, or you might reference another file if you are using the same list of queue names over and over.

//QLOAD    JOB
//*********************************************************************
//* QLOAD Load to many queues
//*********************************************************************
//PUTMANY  EXEC PGM=QLOAD,
//         PARM=('-m MQG1 -o "file:DD:QLIST1" -f DD:MSGTEXT')
//STEPLIB  DD DSN=GEMUSER.USER.LOAD,DISP=SHR                         
//         DD DSN=IBM.MQ.SCSQAUTH,DISP=SHR                           
//         DD DSN=IBM.MQ.SCSQANLE,DISP=SHR                           
//SYSPRINT DD SYSOUT=*  
//SYSOUT   DD SYSOUT=*      
//MSGTEXT  DD DSN=GEMUSER.MSGFILES(EXMPL1),DISP=SHR
//MQGEML   DD DSN=GEMUSER.MQGEM.LIC,DISP=SHR
//QLIST1   DD *
Q1
Q2
Q3
Q4
/*
//

This is not a new feature of QLOAD – it has been there since January 2016, but I was prompted to write about it because of a question from someone who didn’t know about the destination files.


Read more about the QLOAD program, and download a copy, from the QLOAD Download Page. If you don’t have a licence and would like to try out QLOAD then send an email to support@mqgem.com and a 1-month trial licence will be sent to you.

The team at MQGem would love to hear what you think. Leave your comments here.

This site uses Akismet to reduce spam. Learn how your comment data is processed.