How to run several dssh scripts in one batch
Moderators: chulett, rschirm, roy
How to run several dssh scripts in one batch
Hi,
I would like to realize one function retrieving the hash_num for one job using shellscript,the server is of AIX
What I do now in the script file is
'hellp' is project name and 'Test' is the job name
dssh<<eof
logto hellp
select JOBNO FROM DS_JOBS WHERE NAME ='Test'
quit
eof
But it will take long time to run and return no record,
BTW I type the command as following
dssh<<eof
>logto hellp
>SELECT JOBNO FROM DS_JOBS WHERE NAME = 'Test'
>QUIT
It is OK
Can any one of you post kindly advice here...
I would like to realize one function retrieving the hash_num for one job using shellscript,the server is of AIX
What I do now in the script file is
'hellp' is project name and 'Test' is the job name
dssh<<eof
logto hellp
select JOBNO FROM DS_JOBS WHERE NAME ='Test'
quit
eof
But it will take long time to run and return no record,
BTW I type the command as following
dssh<<eof
>logto hellp
>SELECT JOBNO FROM DS_JOBS WHERE NAME = 'Test'
>QUIT
It is OK
Can any one of you post kindly advice here...
Let's Progress Together....
try
Note the switching off of case inversion and the semicolon on the SQL
Code: Select all
dssh<<eof
pterm case noinvert
SELECT JOBNO FROM DS_JOBS WHERE NAME = 'Test';
QUIT;
eof
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
dssh<<eof
pterm case noinvert
SELECT JOBNO FROM DS_JOBS WHERE NAME = 'Test';
QUIT
eof
Hi ArndW&ray,
Thank you for your kindly inputs,and the script as above works,I have another question here,is there any way so as I have transfer the output of the Select query to one Unix variable or plain file. I have tried adding redirection symbol '>'
following <<eof and eof and SELECT JOBNO FROM DS_JOBS WHERE NAME = 'Test'; but none of them works,,,
pterm case noinvert
SELECT JOBNO FROM DS_JOBS WHERE NAME = 'Test';
QUIT
eof
Hi ArndW&ray,
Thank you for your kindly inputs,and the script as above works,I have another question here,is there any way so as I have transfer the output of the Select query to one Unix variable or plain file. I have tried adding redirection symbol '>'
following <<eof and eof and SELECT JOBNO FROM DS_JOBS WHERE NAME = 'Test'; but none of them works,,,
Let's Progress Together....
How about just using SH scripting
(from UNIX)
cd {project directory}
dssh "SELECT JOBNO FROM DS_JOBS WHERE NAME = 'Test';" > textfile.txt
(from UNIX)
cd {project directory}
dssh "SELECT JOBNO FROM DS_JOBS WHERE NAME = 'Test';" > textfile.txt
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
Hi ArndW,
Thank you for input, the method mentioned does work,bu it is said it is not a good habit to run dssh/uvsh under other paths than $DSHOME,
And I have achieved this by function calling,detailed as following:
。。。。。。。。。。。。。。。。
run_dssh()
{ a=$1
b=$2
cd $a
dssh<<eof
LOGTO $2
SELECT * FROM DS_JOBS;
QUIT
eof
}
run_dssh $DSHOME $pro_name > ./filename
。。。。。。。。。。。。。。。。
Hence the record returned by the SELECT query will be returned to file filename under present path
However,I have another question now,is there any way to run "dssh SELECT * FROM RT_LOG$HASH_NUM" under path $DSHOME,however the RT_LOG$HASH_NUM" is under some project path
Thank you for input, the method mentioned does work,bu it is said it is not a good habit to run dssh/uvsh under other paths than $DSHOME,
And I have achieved this by function calling,detailed as following:
。。。。。。。。。。。。。。。。
run_dssh()
{ a=$1
b=$2
cd $a
dssh<<eof
LOGTO $2
SELECT * FROM DS_JOBS;
QUIT
eof
}
run_dssh $DSHOME $pro_name > ./filename
。。。。。。。。。。。。。。。。
Hence the record returned by the SELECT query will be returned to file filename under present path
However,I have another question now,is there any way to run "dssh SELECT * FROM RT_LOG$HASH_NUM" under path $DSHOME,however the RT_LOG$HASH_NUM" is under some project path
ArndW wrote:How about just using SH scripting
(from UNIX)
cd {project directory}
dssh "SELECT JOBNO FROM DS_JOBS WHERE NAME = 'Test';" > textfile.txt ...
Last edited by hailun on Fri Sep 11, 2009 8:39 pm, edited 1 time in total.
Let's Progress Together....
I don't know why you think it is bad to call up dssh outside of the $DSHOME directory - I think it is better and safer, as the "UV" account, if inadvertantly modified, can affect all projects on the system.
The question regardnig accessing the RT_LOGnnn file(s) in a different project from within the UV project is answered with a definitive "NO", as you do not want to add remote file pointers to the main UV account.
The question regardnig accessing the RT_LOGnnn file(s) in a different project from within the UV project is answered with a definitive "NO", as you do not want to add remote file pointers to the main UV account.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
Yeah,although I could not read the fulltext of comments posted by you,I can know you are supporting running dssh under project path other thant $DSHOME
And in fact,few persons I know care under which folder the dssh is executed.
I believe we can resolve my last question someday in future...
As you have support resolving two queries factly,I would like to mark this topic resolved here..
Thank you both....
And in fact,few persons I know care under which folder the dssh is executed.
I believe we can resolve my last question someday in future...
As you have support resolving two queries factly,I would like to mark this topic resolved here..
Thank you both....
ArndW wrote:I don't know why you think it is bad to call up dssh outside of the $DSHOME directory - I think it is better and safer, as the "UV" account, if inadvertantly modified, can affect all projects on the s ...
Let's Progress Together....
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
dssh can be run satisfactorily in any project directory, as well as in $DSHOME - each project directory is an "account" for dssh. But it is vital that the dsenv script has been executed first - that's why (I believe) advice is usually given to execute in $DSHOME, the location of the dsenv script.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.