ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » Mainframe, CICS, TXSeries » How to clear the messages from a queue ?

Post new topic  Reply to topic
 How to clear the messages from a queue ? « View previous topic :: View next topic » 
Author Message
Cogito-Ergo-Sum
PostPosted: Sat Apr 08, 2006 11:03 am    Post subject: How to clear the messages from a queue ? Reply with quote

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
View user's profile Send private message
PeterPotkay
PostPosted: Sat Apr 08, 2006 12:59 pm    Post subject: Re: How to clear the messages from a queue ? Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7717

Cogito-Ergo-Sum wrote:
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.

Sure it is. Look here:
http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/topic/com.ibm.mq.csqzaj.doc/clrql.htm

I just tried it and it works.
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
Cogito-Ergo-Sum
PostPosted: Sat Apr 08, 2006 10:59 pm    Post subject: Reply with quote

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
View user's profile Send private message
bob_buxton
PostPosted: Sun Apr 09, 2006 2:26 am    Post subject: Reply with quote

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
View user's profile Send private message
Cogito-Ergo-Sum
PostPosted: Sun Apr 09, 2006 2:52 am    Post subject: Reply with quote

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
View user's profile Send private message
zpat
PostPosted: Sun Apr 09, 2006 4:55 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5849
Location: UK

It's an option (CLEAR QUEUE) on the standard MQ ISPF interface under MANAGE.
Back to top
View user's profile Send private message
Umeshrath
PostPosted: Thu Apr 20, 2006 6:58 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
bob_buxton
PostPosted: Fri Apr 21, 2006 12:41 am    Post subject: Reply with quote

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
View user's profile Send private message
Mr Butcher
PostPosted: Fri Apr 21, 2006 12:45 am    Post subject: Reply with quote

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
View user's profile Send private message
Umeshrath
PostPosted: Fri Apr 21, 2006 7:05 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
uammony
PostPosted: Sun Apr 23, 2006 1:56 pm    Post subject: Mainframe and CICS Reply with quote

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
View user's profile Send private message
wschutz
PostPosted: Sun Apr 23, 2006 2:00 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail AIM Address
Cogito-Ergo-Sum
PostPosted: Sun Apr 23, 2006 6:36 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » Mainframe, CICS, TXSeries » How to clear the messages from a queue ?
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.