Author |
Message
|
VijayGoparaju` |
Posted: Mon Mar 02, 2009 2:59 am Post subject: Deleting a particular number of Messages from the Queue |
|
|
Acolyte
Joined: 26 Aug 2008 Posts: 72
|
Hi All,
I have a requirement, I want to delete a particular number of messages from a queue (ex: If I have 50 messages in a Queue I want to delete messages from 20 to 30).
I have checked the methods but i didnt found any.Please help me
Thanks,
Vijay... |
|
Back to top |
|
 |
Vitor |
Posted: Mon Mar 02, 2009 3:02 am Post subject: Re: Deleting a particular number of Messages from the Queue |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
VijayGoparaju` wrote: |
I have a requirement, I want to delete a particular number of messages from a queue (ex: If I have 50 messages in a Queue I want to delete messages from 25 to 50). |
It's a rather odd requirement. Typcially you'd flush the entire queue, or delete by date, or delete by content.
VijayGoparaju` wrote: |
I have checked the methods but i didnt found any. |
There's nothing out of the box that will do this. If it's a one-off task you could unload the queue, delete the messages you want and reload the queue; if it's an on-going task you'll need to write an app to do it. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
MQEnthu |
Posted: Mon Mar 02, 2009 3:29 am Post subject: |
|
|
 Partisan
Joined: 06 Oct 2008 Posts: 329 Location: India
|
There are many utils/supportpacks like MO71 which helps you to do this...
If you want to do it in application, you may have to browse the messages till you get the desired sequence then do the destructive get ... _________________ -----------------------------------------------
It is good to remember the past,
but don't let past capture your future |
|
Back to top |
|
 |
VijayGoparaju` |
Posted: Wed Mar 04, 2009 6:53 pm Post subject: |
|
|
Acolyte
Joined: 26 Aug 2008 Posts: 72
|
Is there any way to do this???? |
|
Back to top |
|
 |
MQEnthu |
Posted: Wed Mar 04, 2009 8:38 pm Post subject: |
|
|
 Partisan
Joined: 06 Oct 2008 Posts: 329 Location: India
|
VijayGoparaju wrote: |
Is there any way to do this???? |
Vitor wrote: |
VijayGoparaju wrote: |
I have a requirement, I want to delete a particular number of messages from a queue (ex: If I have 50 messages in a Queue I want to delete messages from 25 to 50). |
It's a rather odd requirement. Typcially you'd flush the entire queue, or delete by date, or delete by content.
VijayGoparaju wrote: |
I have checked the methods but i didnt found any. |
There's nothing out of the box that will do this. If it's a one-off task you could unload the queue, delete the messages you want and reload the queue; if it's an on-going task you'll need to write an app to do it. |
MQEnthu wrote: |
There are many utils/supportpacks like MO71 which helps you to do this...
If you want to do it in application, you may have to browse the messages till you get the desired sequence then do the destructive get ... |
 _________________ -----------------------------------------------
It is good to remember the past,
but don't let past capture your future |
|
Back to top |
|
 |
Toronto_MQ |
Posted: Thu Mar 05, 2009 6:37 am Post subject: |
|
|
 Master
Joined: 10 Jul 2002 Posts: 263 Location: read my name
|
To add to the other suggestions, MO03 will do this easily.
http://www-01.ibm.com/support/docview.wss?rs=171&uid=swg24009368&loc=en_US&cs=utf-8&lang=en
ie. qload -IMYQUEUE -fMYFILE -r20..30
>qload
QLOAD Program by Paul Clarke [ V1.4 Build:Mar 29 2007 ]
(c) Copyright IBM Corp. 2005, 2006
Usage: QLOAD <Optional flags as below>
[-a <File access mode for fopen()>
a Append
b Binary
[-c <CCSID>[:X'Encoding'] Convert]
[-C [A][I][a][i][d][n] Context]
A Set all context (default)
I Set identity context
a Pass all context
i Pass identity context
d Default context
n No context
[-d <Display Options>]
a Add ASCII columns to HEX file
A Write ASCII lines rather than HEX
i Write message index
T Display time on queue
[-f <File Name> or -f <stdout>]
[-F <File Name> (forcing overwrite)]
[-i <Input Queue> (Browse)]
[-I <Input Queue> (Get)]
[-l <library name> e.g.mqm or mqic32]
[-m <Queue Manager name>]
[-o <Output Queue>]
[-p Purge source queue]
[-q Quiet]
[-r <Message Range>]
x Message x only
x..y Message x to message y
x#y y messages starting at message x
#x First x messages
[-t <Transaction Message Limit>]
[-T <Time on queue (Age) selection>
[[[DD:]HH:]MM ][,[[DD:]HH:]MM]
[-s <Ascii Search String>]
[-S <Ascii Not Search String>]
[-e <Ebcdic Search String>]
[-E <Ebcdic Not Search String>]
[-w <MQGET Wait interval(seconds)]
[-x <Hex Search String>]
[-X <Hex Not Search String>]
Examples
--------
Unload a queue to a file : qload -iQ1 -fmyfile
Load a queue from a file : qload -oQ1 -fmyfile
Copy a queue from Q1 to Q2 : qload -iQ1 -oQ2
Move a queue from Q1 to Q2 : qload -IQ1 -oQ2
Move old messages from Q1 to Q2 : qload -IQ1 -oQ2 -T1440
Convert from old file to new : qload -foldfile -fnewfile -da |
|
Back to top |
|
 |
|