Author |
Message
|
Cogito-Ergo-Sum |
Posted: Sat Apr 08, 2006 11:03 am Post subject: How to clear the messages from a queue ? |
|
|
 Master
Joined: 07 Feb 2006 Posts: 293 Location: Bengaluru, India
|
Hi,
We are on IBM WebSphere MQ for z/OS V6. Is it possible to drain the messages off the queue without running an application program that does MQGET for the messages ?
I looked up the Command Reference manual and found a CLEAR QLOCAL command, which is NOT applicable for OS/390. Search on the net has not been fruitful either. _________________ ALL opinions are welcome.
-----------------------------
Debugging tip:When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
---Sherlock Holmes |
|
Back to top |
|
 |
PeterPotkay |
Posted: Sat Apr 08, 2006 12:59 pm Post subject: Re: How to clear the messages from a queue ? |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
|
Back to top |
|
 |
Cogito-Ergo-Sum |
Posted: Sat Apr 08, 2006 10:59 pm Post subject: |
|
|
 Master
Joined: 07 Feb 2006 Posts: 293 Location: Bengaluru, India
|
Strange. Before posting, I tried this,
Code: |
//STEP002 EXEC PGM=CSQUTIL,
// PARM='QMGR',
// COND=(0,LT)
//STEPLIB DD DSN=HLQ.SCSQANLE,DISP=SHR
// DD DSN=HKQ.SCSQAUTH,DISP=SHR
//SYSIN DD *
CLEAR QLOCAL(HLQ.MLQ.Q00291)
/*
//SYSPRINT DD SYSOUT=I |
for which I get,
Code: |
CSQU000I CSQUTIL IBM WebSphere MQ for z/OS V6
CSQU001I CSQUTIL Queue Manager Utility - 2006-04-09 04:46:53
CLEAR QLOCAL(HLQ.MLQ.Q00291)
CSQU106E Invalid function CLEAR
CSQU147I CSQUTIL Utility terminated, return code=12 |
_________________ ALL opinions are welcome.
-----------------------------
Debugging tip:When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
---Sherlock Holmes |
|
Back to top |
|
 |
bob_buxton |
Posted: Sun Apr 09, 2006 2:26 am Post subject: |
|
|
 Master
Joined: 23 Aug 2001 Posts: 266 Location: England
|
That is because CLEAR is an MQ command and not a CSQUTIL function.
To issue commands from CSQUTIL you need
Code: |
//STEP002 EXEC PGM=CSQUTIL,
// PARM='QMGR',
// COND=(0,LT)
//STEPLIB DD DSN=HLQ.SCSQANLE,DISP=SHR
// DD DSN=HKQ.SCSQAUTH,DISP=SHR
//SYSIN DD *
COMMAND
//CSQUCMD DD *
CLEAR QLOCAL(HLQ.MLQ.Q00291)
/*
//SYSPRINT DD SYSOUT=I
|
_________________ Bob Buxton
Ex-Websphere MQ Development |
|
Back to top |
|
 |
Cogito-Ergo-Sum |
Posted: Sun Apr 09, 2006 2:52 am Post subject: |
|
|
 Master
Joined: 07 Feb 2006 Posts: 293 Location: Bengaluru, India
|
ooooooooooooohhhhhhhhhh!!!!
Thank you, Bob! It is working now. _________________ ALL opinions are welcome.
-----------------------------
Debugging tip:When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
---Sherlock Holmes |
|
Back to top |
|
 |
zpat |
Posted: Sun Apr 09, 2006 4:55 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
It's an option (CLEAR QUEUE) on the standard MQ ISPF interface under MANAGE. |
|
Back to top |
|
 |
Umeshrath |
Posted: Thu Apr 20, 2006 6:58 pm Post subject: |
|
|
Novice
Joined: 27 Dec 2005 Posts: 23 Location: Hyderabad
|
I tried the same JCL but its giving the following error message.
The below is my JCL with the error message.
//STEP010 EXEC PGM=CSQUTIL,
// PARM='SMQE'
//STEPLIB DD DSN=SYS1.SCSQANLE,DISP=SHR
// DD DSN=SYS1.SCSQAUTH,DISP=SHR
//SYSIN DD *
COMMAND
//CSQUCMD DD *
CLEAR QLOCAL(SMQE.HSSERR)
/*
//SYSPRINT DD SYSOUT=*
This is my job. HSSERR is the name of the queue.
In the JCL provided by you you hav written that
CLEAR QLOCAL(HLQ.your queue)
What is this HLQ? Do we have to write HLQ.HSSERR. I tried that also.
But i am getting the following message in my spool.
COMMAND
CSQU127I Executing COMMAND using input from CSQUCMD data set
CSQU120I Connecting to SMQE
CSQU121I Connected to queue manager SMQE
CSQU055I Target queue manager is SMQE
CLEAR QLOCAL(SMQE.HSSERR)
CSQN205I COUNT= 3, RETURN=00000020, REASON=FFFFFFFF
CSQ9016E )SE CLEAR COMMAND REJECTED, UNAUTHORIZED REQUEST
CSQ9023E )SE CSQ9SCND 'CLEAR QLOCAL' ABNORMAL COMPLETION
CSQU057I 1 commands read
CSQU058I 1 commands issued and responses received, 1 failed
CSQU143I 1 COMMAND statements attempted
CSQU144I 1 COMMAND statements executed successfully
CSQU148I CSQUTIL Utility completed, return code=0 _________________ Umesh Rath |
|
Back to top |
|
 |
bob_buxton |
Posted: Fri Apr 21, 2006 12:41 am Post subject: |
|
|
 Master
Joined: 23 Aug 2001 Posts: 266 Location: England
|
You don't provide any prefix for the queue name in the CLEAR command.
The CSQ9016E message indicates that your installation has restricted the use of the CLEAR QLOCAL command and that you have not been granted permission. You will need to talk to the person responsible for MQ security administration at your site
Alternatively you could use one of the many utility programs that can empty a queue by repeatedly issuing MQGET. _________________ Bob Buxton
Ex-Websphere MQ Development |
|
Back to top |
|
 |
Mr Butcher |
Posted: Fri Apr 21, 2006 12:45 am Post subject: |
|
|
 Padawan
Joined: 23 May 2005 Posts: 1716
|
@Umeshrath
Quote: |
CSQ9016E )SE CLEAR COMMAND REJECTED, UNAUTHORIZED REQUEST |
sorry, but i can not take this post for serious. even if you are new and start with things, you should be able to read the error messages you get. _________________ Regards, Butcher |
|
Back to top |
|
 |
Umeshrath |
Posted: Fri Apr 21, 2006 7:05 am Post subject: |
|
|
Novice
Joined: 27 Dec 2005 Posts: 23 Location: Hyderabad
|
Thanks Butcher.
From now onwards i will try to understand the error message.
But as u know its always difficult for a starter to understand the spool message and reached a conclusion.
Thanks a lot to everybody.
Regards,
Umesh _________________ Umesh Rath |
|
Back to top |
|
 |
uammony |
Posted: Sun Apr 23, 2006 1:56 pm Post subject: Mainframe and CICS |
|
|
Newbie
Joined: 23 Apr 2006 Posts: 2
|
Hi,
To clear all messages from a local queue in MQ z/OS . The following JCl will work.
//STEP002 EXEC PGM=CSQUTIL,
// PARM='QMGR',
// COND=(0,LT)
//STEPLIB DD DSN=HLQ.SCSQANLE,DISP=SHR
// DD DSN=HKQ.SCSQAUTH,DISP=SHR
//SYSIN DD *
EMPTY QUEUE(HLQ.MLQ.Q00291)
/*
//SYSPRINT DD SYSOUT=I |
|
Back to top |
|
 |
wschutz |
Posted: Sun Apr 23, 2006 2:00 pm Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
Hey, why stop there? Why not delete all the queues in a pageset:
Code: |
//EMPTY EXEC PGM=CSQUTIL,PARM=('CSQ1')
//STEPLIB DD DISP=SHR,DSN=thlqual.SCSQANLE
// DD DISP=SHR,DSN=thlqual.SCSQAUTH
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
EMPTY PSID(66)
/*
|
_________________ -wayne |
|
Back to top |
|
 |
Cogito-Ergo-Sum |
Posted: Sun Apr 23, 2006 6:36 pm Post subject: |
|
|
 Master
Joined: 07 Feb 2006 Posts: 293 Location: Bengaluru, India
|
wschutz wrote: |
Hey, why stop there? Why not delete all the queues in a pageset:
Code: |
//EMPTY EXEC PGM=CSQUTIL,PARM=('CSQ1')
//STEPLIB DD DISP=SHR,DSN=thlqual.SCSQANLE
// DD DISP=SHR,DSN=thlqual.SCSQAUTH
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
EMPTY PSID(66)
/*
|
|
Because, we do not want to chop off the head for a headache.  _________________ ALL opinions are welcome.
-----------------------------
Debugging tip:When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
---Sherlock Holmes |
|
Back to top |
|
 |
|