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 » General IBM MQ Support » DOS script to automate mqgr management

Post new topic  Reply to topic
 DOS script to automate mqgr management « View previous topic :: View next topic » 
Author Message
jeevan
PostPosted: Sun Sep 17, 2006 7:18 am    Post subject: DOS script to automate mqgr management Reply with quote

Grand Master

Joined: 12 Nov 2005
Posts: 1432

Now I am working on windows Mq. I am trying to convert (rewrite) the unix scripts but having trouble.

First question cat it be achived the same level of automation of qmgr management in windows based mq as unix (aix) based mq?

When I tried a simple unix script to DOS, it did not work. Can you some one tell me what mistake I am making.

the script is to delete all the queue manager.

FOR %%QMGR IN (DSPMQ) DO dltmqm %%QMGR

what is wrong with it? i looked this syntax of for in dos help and tried a few times.

thanks in advance
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Sun Sep 17, 2006 7:29 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

I don't believe your DSPMQ variable has been correctly assigned/initialized. You could put a few echo statements in there as debugging help.

I would try
Code:
dspmq | "set DSPMQ="
but then I am no Dos scripting guru either so take it with a lot of salt...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
jeevan
PostPosted: Sun Sep 17, 2006 7:49 am    Post subject: Reply with quote

Grand Master

Joined: 12 Nov 2005
Posts: 1432

thanks anyway. Is there any windows mq gurus?

I am not trying to do this for fun. I have mq 6 installed. I have to intalla mq 5.3 for some reason. When I did that I realied that the previous qmgrs ( created in mq6) did not work. Also I do not need them. there are lot of them. So, instead of deleting one by one, thought to write a script equivalent of unix:

for qmgr in dspmq; do
dltmqm $qmgr
done


as simple as this. But I would not be able to do this. the syntax for FOR in dos as follows:

DO %%VAR IN (SET) DO COMMAND COMMAND PARAMETER

but I could not get it working.

thanks
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Sun Sep 17, 2006 2:50 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Did you think about doing something like this:

dspmq > myfile
For %% QMGR IN myfile ....
or for %% QMGR in file myfile.... or however DOS scripting describes it...?
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
wschutz
PostPosted: Sun Sep 17, 2006 3:56 pm    Post subject: Reply with quote

Jedi Knight

Joined: 02 Jun 2005
Posts: 3316
Location: IBM (retired)

Maybe this will help (or may be it won't):
http://www.robvanderwoude.com/index.html
_________________
-wayne
Back to top
View user's profile Send private message Send e-mail AIM Address
jeevan
PostPosted: Sun Sep 17, 2006 4:34 pm    Post subject: Reply with quote

Grand Master

Joined: 12 Nov 2005
Posts: 1432

Thank you for leading me toward the solution. The following script did the job


FOR /F "tokens=2 delims=(, " %%i in (t.txt) do @echo %%i >>t1
FOR /F "tokens=1 delims=), " %%i in (t1) do @echo %%i >>t2

FOR /F "tokens=1 delims=, " %%i in (t2) do dltmqm %%i


Thanks once again,
Back to top
View user's profile Send private message
jeevan
PostPosted: Sun Sep 17, 2006 4:36 pm    Post subject: Reply with quote

Grand Master

Joined: 12 Nov 2005
Posts: 1432

Sorry t.txt is the output of dspmq
Back to top
View user's profile Send private message
jeevan
PostPosted: Sun Sep 17, 2006 4:52 pm    Post subject: Reply with quote

Grand Master

Joined: 12 Nov 2005
Posts: 1432

Thank you Wayne. The link is very much usefull.
Back to top
View user's profile Send private message
JasonE
PostPosted: Mon Sep 18, 2006 1:31 am    Post subject: Reply with quote

Grand Master

Joined: 03 Nov 2003
Posts: 1220
Location: Hursley

How about

for /F "usebackq delims==() tokens=2" %%i in (`dspmq`) do dltmqm %%i

Dos batch language rules ok
Back to top
View user's profile Send private message
jeevan
PostPosted: Mon Sep 18, 2006 2:31 am    Post subject: Reply with quote

Grand Master

Joined: 12 Nov 2005
Posts: 1432

Hi JasonE,

It worked perfectly. I read about usebackq delim but did not think exaclty how it works. Thanks a lot.
Back to top
View user's profile Send private message
Michael Dag
PostPosted: Mon Sep 18, 2006 3:03 am    Post subject: Reply with quote

Jedi Knight

Joined: 13 Jun 2002
Posts: 2607
Location: The Netherlands (Amsterdam)

from the past... http://www.mqseries.net/phpBB2/viewtopic.php?t=12704&highlight=script
_________________
Michael



MQSystems Facebook page
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
jeevan
PostPosted: Mon Sep 18, 2006 3:33 am    Post subject: Reply with quote

Grand Master

Joined: 12 Nov 2005
Posts: 1432

I searched this forum I dunno how I missed that. Anyway, thanks again bringing this useful stuff to notice.

You all are great
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 » General IBM MQ Support » DOS script to automate mqgr management
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.