Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OS/ 390 example JCL please

Status
Not open for further replies.

ghalewood

Programmer
Nov 13, 2001
42
EU
Does anyone have some example OS/390 JCL to issue a MQGET to retrieve a message and put it into a normal sequential dataset. I know this is a basic question (I might even be missing the point of MQ totally), but until last week, I had never heard of MQseries.

Thanks in anticipation.

Graham
 
Graham

It really depends on what you are asking for here. Most companies will have code that will read a message from a specific Queue and then process it in some way (which could include writing the message to a flat file.

IBM supply a fair amount of sample code (in a few different programming languages). You may want to try looking in the SYS1.SCSQ***S libraries for something to use as a starting point. Then there is also CSQUTIL (See System Administraion Guide) that will copy messages to a flat file...but this tends to be more for backup than anything else.

Other than that I am afaid you may have to 'roll your own' or have someone provide you with their own home grown utility.

If you need to simply read the messages (destructively) and write them to a dataset, then I have something that will do that, but you will need more that just JCL. :)
 
With OS/390 you can also copy the contents of a queue to a sequential dataset which you can then use to reload that or another queue. This is obviously useful for testing purposes where you load a queue with test data, process it, reload the queue and retest etc. Note that the RECFM of the dataset is VBS so you probably won't be able to do much with it outside of this.

Use the CSQUTIL command and then either COPY or SCOPY depending upon whether you want to do this with the QMgr running or down.

See MQSeries for OS/390 System Administration for more info and this sample JCL:

[tt]//COPY EXEC PGM=CSQUTIL,PARM='CSQ1'
//STEPLIB DD DISP=SHR,DSN=thlqual.SCSQANLE
// DD DISP=SHR,DSN=thlqual.SCSQAUTH
//OUTPUTA DD DSN=SAMPLE.UTILITY.COPYA,DISP=(NEW,CATLG),
// SPACE=(CYL,(5,1),RLSE),UNIT=SYSDA,
// DCB=(RECFM=VBS,BLKSIZE=23200)
//CSQUOUT DD DSN=SAMPLE.UTILITY.COPY3,DISP=(NEW,CATLG),
// SPACE=(CYL,(5,1),RLSE),UNIT=SYSDA,
// DCB=(RECFM=VBS,BLKSIZE=23200)
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
* COPY WHOLE PAGE SET TO 'CSQUOUT'
COPY PSID(03)
* COPY ONE QUEUE TO 'OUTPUT'
COPY QUEUE(ABC123A) DDNAME(OUTPUTA)
/*[/tt]

Cheers,
Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top