Author |
Message
|
blegris |
Posted: Thu Mar 22, 2007 12:43 pm Post subject: Can you have MQSC command line parameters |
|
|
Newbie
Joined: 22 Mar 2007 Posts: 4
|
I have a mqsc script to setup a Queue Managers and all its mq objects. I want to be able to dynamically pass in the queue manager name to the script. Is it possible to have command line parameters or dynamic parameters for the runmqsc scripts?
Any ideas on how to do that?
Thanks in advance.
Brent |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Mar 22, 2007 12:49 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Start with normal shell scripting. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
marcin.kasinski |
Posted: Thu Mar 22, 2007 12:51 pm Post subject: Re: Can you have MQSC command line parameters |
|
|
Sentinel
Joined: 21 Dec 2004 Posts: 850 Location: Poland / Warsaw
|
blegris wrote: |
I have a mqsc script to setup a Queue Managers and all its mq objects. I want to be able to dynamically pass in the queue manager name to the script. Is it possible to have command line parameters or dynamic parameters for the runmqsc scripts?
Any ideas on how to do that?
Thanks in advance.
Brent |
We have template mqsc file and additional file with parameters.
Then running our code we merge template and parametr file and create out mqsc file.
This code could be everything perl, regexp, ... _________________ Marcin |
|
Back to top |
|
 |
anantha sreenivasan |
Posted: Fri Mar 23, 2007 3:00 am Post subject: |
|
|
Acolyte
Joined: 26 Sep 2006 Posts: 72
|
Adding to the above replies,
you can also indirect queue creation scripts to a queue manager through a file.
Suppose you have all the object definitions to be created in a queue manager in a file say obj.txt
You can create objects in the queue manager by indirecting this file from command prompt through runmqsc and also write output of the commands to a file
Example: runmqsc QMGRNAME < obj.txt > out.txt
where out.txt contains the output of the commands |
|
Back to top |
|
 |
Pankaj |
Posted: Fri Mar 23, 2007 3:40 am Post subject: |
|
|
Newbie
Joined: 18 May 2004 Posts: 8 Location: India
|
there r some more tricky ways ...which may help you in writing script with small changes...
check out http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/index.jsp for example script file...You can modify this script to accept arguments from command prompt.
You can also pass MQSC commands from cmd...
On Windows: echo ALTER QMGR SCMDSERV(QMGR) | runmqsc Queue_Manager_Name
On UNIX: echo "ALTER QMGR SCMDSERV(QMGR)" | runmqsc Queue_Manager_Name
Hope it will help... |
|
Back to top |
|
 |
marcin.kasinski |
Posted: Fri Mar 23, 2007 4:07 am Post subject: |
|
|
Sentinel
Joined: 21 Dec 2004 Posts: 850 Location: Poland / Warsaw
|
Pankaj wrote: |
You can also pass MQSC commands from cmd...
On Windows: echo ALTER QMGR SCMDSERV(QMGR) | runmqsc Queue_Manager_Name
On UNIX: echo "ALTER QMGR SCMDSERV(QMGR)" | runmqsc Queue_Manager_Name
|
I wouldn’t recommend this.
For simple operation it is ok, but if in your you have to execute lots of commands it would be time consuming.
It's my opinion. _________________ Marcin |
|
Back to top |
|
 |
|