Author |
Message
|
jeevan |
Posted: Mon Jan 30, 2006 11:16 am Post subject: Diplaying filtered queues in MQSC ENV |
|
|
Grand Master
Joined: 12 Nov 2005 Posts: 1432
|
Hi guys,
I want to display all the queues except SYSTEM. How can i do that? Is there someting like
dis q(!system.)
I would be grateful if you could help me.
thanks |
|
Back to top |
|
 |
wschutz |
Posted: Mon Jan 30, 2006 11:29 am Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
I don't think you can do this, even with MQ V6 (which has the "where" clause).
Best bet is to run runmqsc or saveqmgr with oneline option and grep the output for what you want. _________________ -wayne |
|
Back to top |
|
 |
csmith28 |
Posted: Mon Jan 30, 2006 11:41 am Post subject: |
|
|
 Grand Master
Joined: 15 Jul 2003 Posts: 1196 Location: Arizona
|
In Unix if you want to creat a file that does not include the names of the SYSTEM.* queues, do the following:
Code: |
ksh
set -o vi
echo "dis q(*)" | runmqsc QMGNAME | grep QUEUE > qoutall.txt
grep -v SYSTEM > qout.txt |
the qout.txt file will contain all the Queue names that do not have SYSTEM in them. _________________ Yes, I am an agent of Satan but my duties are largely ceremonial. |
|
Back to top |
|
 |
jeevan |
Posted: Mon Jan 30, 2006 11:46 am Post subject: |
|
|
Grand Master
Joined: 12 Nov 2005 Posts: 1432
|
thanks guys
I also have one more thing to do and need help. How can i grep the first column in
QMNAME(QM2) STATUS(Running)
this display.
I need to grep the qmname column only in unix.
thanks for help |
|
Back to top |
|
 |
csmith28 |
Posted: Mon Jan 30, 2006 11:55 am Post subject: |
|
|
 Grand Master
Joined: 15 Jul 2003 Posts: 1196 Location: Arizona
|
jeevan wrote: |
thanks guys
I also have one more thing to do and need help. How can i grep the first column in
QMNAME(QM2) STATUS(Running)
this display.
I need to grep the qmname column only in unix.
thanks for help |
Code: |
echo "dis qmgr" | runmqsc QMGRNAME | grep QMNAME | awk '{print $1}' |
will echo QMNAME and it's value as in QMNAME(QM02) or whatever. _________________ Yes, I am an agent of Satan but my duties are largely ceremonial.
Last edited by csmith28 on Mon Jan 30, 2006 1:12 pm; edited 1 time in total |
|
Back to top |
|
 |
vennela |
Posted: Mon Jan 30, 2006 11:55 am Post subject: |
|
|
 Jedi Knight
Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India
|
Do you want:
QMNAME(QM2)
or
QM2
If former:
Code: |
dspmq | awk '{print $1}' |
If later:
Code: |
dspmq | awk -F \( '{print $2}' | awk -F \) '{print $1}' |
On Solaris, you have to do it slightly different, but I guess you got the idea. |
|
Back to top |
|
 |
csmith28 |
Posted: Mon Jan 30, 2006 12:00 pm Post subject: |
|
|
 Grand Master
Joined: 15 Jul 2003 Posts: 1196 Location: Arizona
|
vennela wrote: |
Do you want:
QMNAME(QM2)
or
QM2
If former:
Code: |
dspmq | awk '{print $1}' |
If later:
Code: |
dspmq | awk -F \( '{print $2}' | awk -F \) '{print $1}' |
On Solaris, you have to do it slightly different, but I guess you got the idea. |
Or what he said. _________________ Yes, I am an agent of Satan but my duties are largely ceremonial. |
|
Back to top |
|
 |
jeevan |
Posted: Mon Jan 30, 2006 1:23 pm Post subject: |
|
|
Grand Master
Joined: 12 Nov 2005 Posts: 1432
|
thanks a lot guys.
jeevan |
|
Back to top |
|
 |
jeevan |
Posted: Tue Jan 31, 2006 6:35 am Post subject: |
|
|
Grand Master
Joined: 12 Nov 2005 Posts: 1432
|
In fact my need is to display all queue manager and queue ( non system) in each of them. I can do now one by one, can someone help how i can look throu the qmgr and display all the queues and store in a file.
thanks |
|
Back to top |
|
 |
wschutz |
Posted: Tue Jan 31, 2006 6:44 am Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
If you use supportpac ms03 (saveqmgr), you can do this (on linux):
Code: |
dspmq | grep 'STATUS(Running)' | sed 's/QMNAME(\(.*\)) *STATUS.*/\1/' | xargs -i ./saveqmgr.linux -s -1 -c -m {} | grep "DEFINE Q" > nonsysq.mqsc
|
It writes all queues to a single file. You can do similiar things in other unices (I think xargs might be a touch different)
-s tells saveqmgr not to write SYSTEM* objects, -1 says "put it all on one line."  _________________ -wayne |
|
Back to top |
|
 |
|