|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
z/OS Move msg from one que to another |
« View previous topic :: View next topic » |
Author |
Message
|
cicsprog |
Posted: Mon Oct 23, 2006 4:44 pm Post subject: z/OS Move msg from one que to another |
|
|
Partisan
Joined: 27 Jan 2002 Posts: 347
|
Along story so here is the short version. MQ Clients camped on a QLOCAL. Had to restore over 15k's worth of messages to a temp queue. Those messages need to be moved to the queue that the MQ Clients are camped on. CSQUTIL would't do the job since it needs exclusive on the destination queue. I ended up using ISPF version of PQEDIT to move them in 1500 message chunks. Any utility I'm missing that would do this job? Or is it roll your own?
Thanks! |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Oct 23, 2006 5:37 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
No Client Attachment Facility? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
cicsprog |
Posted: Mon Oct 23, 2006 6:16 pm Post subject: |
|
|
Partisan
Joined: 27 Jan 2002 Posts: 347
|
"No Client Attachment Facility?"
I'm missing your point...but it has been a long day too .
On our z/OS MQ's we do have the Client Attachment Facility. The MQM was active with MQ Clients but CSQUTIL wouldn't allow a MOVE QLOCAL cmd to work with destination Q busy with MQ Clients camped on it. |
|
Back to top |
|
 |
Mr Butcher |
Posted: Mon Oct 23, 2006 11:45 pm Post subject: |
|
|
 Padawan
Joined: 23 May 2005 Posts: 1716
|
if you have the CAF you could use mqmon (MO71 supportpac) on a windows pc which has move and copy functions.
you could also donwload MA01 supportpac (q program) which is also available for z/Os and run that utility to copy between queues. _________________ Regards, Butcher |
|
Back to top |
|
 |
zpat |
Posted: Tue Oct 24, 2006 12:38 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
Using a client based program means moving the message data off the mainframe and back on to it. Could be a network burden if the messages are large.
Why not write a simple mainframe MQI program in Cobol, REXX etc to get from one queue and put to another? |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Oct 24, 2006 4:01 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Yeah, my point was that if you have CAF, you can use any kind of client program to move the messages.
On the other hand, I agree with zpat that this does involve moving all the message data over the network and this might be unnecessary work. On the other hand, if you're in a pinch and don't have time to get a MQI program written, approved, and then run... then I think the network utilization is worth it. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
kevinf2349 |
Posted: Tue Oct 24, 2006 5:08 am Post subject: |
|
|
 Grand Master
Joined: 28 Feb 2003 Posts: 1311 Location: USA
|
Code: |
//BACKUP EXEC PGM=CSQUTIL,PARM='MQxx'
//STEPLIB DD DSN=SYS1.SCSQLOAD,DISP=SHR
// DD DSN=SYS1.SCSQANLE,DISP=SHR
// DD DSN=SYS1.SCSQAUTH,DISP=SHR
//SYSPRINT DD SYSOUT=*
//BACKUP DD DSN=your.dsn,DISP=(,CATLG,DELETE),
// DCB=(RECFM=VBS,BLKSIZE=23200),UNIT=SYSALLDA,
// VOL=SER=xxxxxx,SPACE=(CYL,(10,30))
//SYSIN DD *
COPY Q(TEST.QUEUE1) DDNAME(BACKUP)
//RESTORE EXEC PGM=CSQUTIL,PARM='MQxx'
//STEPLIB DD DSN=SYS1.SCSQLOAD,DISP=SHR
// DD DSN=SYS1.SCSQANLE,DISP=SHR
// DD DSN=SYS1.SCSQAUTH,DISP=SHR
//SYSIN DD *
LOAD QUEUE(TEST.QUEUE2) DDNAME(INPUT)
//INPUT DD DSN=your.dsn,DISP=SHR
//SYSPRINT DD SYSOUT=* |
That should do it.....of course it copies them, and all of them....but it should work.  |
|
Back to top |
|
 |
cicsprog |
Posted: Tue Oct 24, 2006 5:35 am Post subject: |
|
|
Partisan
Joined: 27 Jan 2002 Posts: 347
|
Thanks....I figured it was roll-your-own or a supportpack with free code to do a queue-to-queue move given the situation Clients camped on the destination Q. It was just such a rare situation to do this that I was hoping it was incorprated in the product. None of the options on CSQUTILs MOVE utility worked with the Clients camped on the Q. I even looked at the DLQ utility to see if I could jury-rig-it .
Thanks Again! |
|
Back to top |
|
 |
zpat |
Posted: Tue Oct 24, 2006 8:04 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
Code: |
/* REXX TO COPY MESSAGES FROM ONE QUEUE TO ANOTHER, USES MA18 */
/* MODULE RXMQV WHICH MUST IN A STEPLIB OR LINKLIST LIBRARY. */
/* MESSAGES WILL BE DESTRUCTIVELY READ, USE BROWSE TO AVOID */
/****************************************************************/
QMGR = 'ABC1'
QNM1 = 'AA.TEST.ONE'
QNM2 = 'AA.TEST.TWO'
MAXL = 1000000 /* MAX MESSAGE LENGTH */
RET = RXMQV('INIT')
RET = RXMQV('CONN', QMGR)
CALL CHECK 'CONNECT'
RET = RXMQV('OPEN', QNM1, MQOO_INPUT_SHARED, 'QHAN1', 'MQOD1.')
CALL CHECK 'OPEN INPUT Q'
RET = RXMQV('OPEN', QNM2, MQOO_OUTPUT, 'QHAN2', 'MQOD2.')
CALL CHECK 'OPEN OUTPUT Q'
IGO.OPT = MQGMO_NO_SYNCPOINT
IPO.OPT = MQPMO_NO_SYNCPOINT
MSG.0 = MAXL
MSG.1 = ''
RET = RXMQV('GET', QHAN1, 'MSG.','IGD.','OGD.','IGO.','OGO.')
RCG = WORD(RET,1)
DO WHILE (RCG = 0)
IPD.PER = OGD.PER /* COPY KEY MQMD FIELDS OVER */
IPD.MSG = OGD.MSG
IPD.EXP = OGD.EXP
IPD.ENC = OGD.ENC
IPD.CCSI = OGD.CCSI
IPD.FORM = OGD.FORM
IPD.MSGID= OGD.MSGID
IPD.CID = OGD.CID
RET = RXMQV('PUT', QHAN2, 'MSG.','IPD.','OPD.','IPO.','OPO.')
RCP = WORD(RET,1)
CALL CHECK 'PUT'
MSG.0 = MAXL
MSG.1 = ''
RET = RXMQV('GET', QHAN1, 'MSG.','IGD.','OGD.','IGO.','OGO.')
RCG = WORD(RET,1)
END
IF RCG = 2033 THEN
SAY 'END OF INPUT QUEUE REACHED' QNM1
ELSE
DO
SAY 'MQGET ERROR, RC' RCG
CALL CHECK 'GET'
END
RET = RXMQV('CLOSE', QHAN1, MQCO_NONE)
RET = RXMQV('CLOSE', QHAN2, MQCO_NONE)
RET = RXMQV('DISC')
RET = RXMQV('TERM')
EXIT 0
CHECK:
ARG TYPE
LASTRC = WORD(RET,1)
IF LASTRC = 0 THEN
RETURN
INTERPRET 'TEXT = RXMQV.RCMAP'LASTRC
SAY 'MQ' TYPE 'CALL FAILED (RETN COMP REAS FUNC)'
SAY RXMQV.LASTMSG
INTERPRET "TEXT = RXMQV.RCMAP."LASTRC
SAY "REASON CODE TEXT :" TEXT
RET = RXMQV('DISC')
RET = RXMQV('TERM')
EXIT 12
|
PS - Use above at own risk, but it does work for me! |
|
Back to top |
|
 |
cicsprog |
Posted: Tue Oct 24, 2006 8:58 am Post subject: |
|
|
Partisan
Joined: 27 Jan 2002 Posts: 347
|
COOL!...thanks for the REXX....I was downloading MA01 also. |
|
Back to top |
|
 |
cicsprog |
Posted: Tue Oct 31, 2006 8:00 am Post subject: |
|
|
Partisan
Joined: 27 Jan 2002 Posts: 347
|
The SupportPac is very useful. Here's an instream PROC to make dealing with long parms easier:
// Jobcard
//*
//***************************************
//*** JCL is (case sensative)
//***************************************
//*** IBM Supportpac MA01
//*** This utility does many things.
//*** But, this example shows moving
//*** messages from Q1 to Q2 while Q2
//*** has open IPROCs
//***************************************
//*** -m"MQM Name" -I"Input Queue"
//*** -O"Output Queue" -L"# msgs to do"
//***************************************
//*** This is a destructive MQGET
//***************************************
//MQUTIL PROC MQM='MQ??',
// QUE1='?????',
// QUE2='?????',
// NMSG='#####'
//*
//QTOQ EXEC PGM=Q,
// PARM=('-m&MQM -I&QUE1 -O&QUE2 -L&NMSG')
//STEPLIB DD DISP=SHR,DSN=HUGHSON.Q.LOAD
// DD DISP=SHR,DSN=MQLIB.SCSQAUTH
// DD DISP=SHR,DSN=MQLIB.SCSQANLE
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
// PEND
//************************************************
//STEP1 EXEC MQUTIL,
// MQM='MQD0',
// QUE1='SYSTEM.DEFAULT.LOCAL.QUEUE',
// QUE2='SYSTEM.DEFAULT.LOCAL.QUEUE2',
// NMSG='10000'
Last edited by cicsprog on Fri Nov 17, 2006 2:18 pm; edited 1 time in total |
|
Back to top |
|
 |
Mr Butcher |
Posted: Tue Oct 31, 2006 8:46 am Post subject: |
|
|
 Padawan
Joined: 23 May 2005 Posts: 1716
|
cewl, thanks for posting that. that will end my parm-string-counting  _________________ Regards, Butcher |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|