Firing query on UNIVERSE through UNIX script
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 14
- Joined: Wed May 05, 2010 1:24 am
Firing query on UNIVERSE through UNIX script
Hi Folks,
Please help me with one issue. I want to know how to execute a query on DS_JOBS through UNIX script.
I know the steps like:
1)LOGTO Project_name
2)Write a query: SELECT COUNT(*) FROM DS_JOBS
But I need to automate this process through UNIX script.
Please suggest.
Please help me with one issue. I want to know how to execute a query on DS_JOBS through UNIX script.
I know the steps like:
1)LOGTO Project_name
2)Write a query: SELECT COUNT(*) FROM DS_JOBS
But I need to automate this process through UNIX script.
Please suggest.
-
- Premium Member
- Posts: 730
- Joined: Tue Nov 04, 2008 10:14 am
- Location: Bangalore
as simple as having the below two commands in your script
however if you let us know what is your actual intension by querying the repository, you might get a better suggestion
Code: Select all
cd "Project directory"
dssh " select * from DS_JOBS ; "
however if you let us know what is your actual intension by querying the repository, you might get a better suggestion
- Zulfi
-
- Participant
- Posts: 14
- Joined: Wed May 05, 2010 1:24 am
Hi Zulfi,
Thanks for your reply.
I have tried this but it is not working.
I will give you one example:
Whenever we have find out the job number of a job , we either fire a query on administrator or do the same through command prompt.
We care doing this through command prompt by just following the below mentioned steps:
1)Go to DSEngine directory
2)fire: . ./dsenv
3)bin/uvsh
4)LOGTO Project_Name
5)fire query: SELECT JOBNO FROM DS_JOBS WHERE NAME='JobName';
The output of the above query is the Job number.
This I am doing manually now but I want to automate this process.
I am finding difficulty from step number 3.
I need to execute the LOGTO and SELECT command on UNIVERSE.
I have tried below mentioned command but it doesn't work:
bin/uvsh < "LOGTO Project_Name";
bin/uvsh < "SELECT * FROM DS_JOBS";
Some how I need to pass step 4 and step 5 command to the UNIVERSE through unix command line.
I hope you have understood my question.
Thanks for your reply.
I have tried this but it is not working.
I will give you one example:
Whenever we have find out the job number of a job , we either fire a query on administrator or do the same through command prompt.
We care doing this through command prompt by just following the below mentioned steps:
1)Go to DSEngine directory
2)fire: . ./dsenv
3)bin/uvsh
4)LOGTO Project_Name
5)fire query: SELECT JOBNO FROM DS_JOBS WHERE NAME='JobName';
The output of the above query is the Job number.
This I am doing manually now but I want to automate this process.
I am finding difficulty from step number 3.
I need to execute the LOGTO and SELECT command on UNIVERSE.
I have tried below mentioned command but it doesn't work:
bin/uvsh < "LOGTO Project_Name";
bin/uvsh < "SELECT * FROM DS_JOBS";
Some how I need to pass step 4 and step 5 command to the UNIVERSE through unix command line.
I hope you have understood my question.
-
- Participant
- Posts: 14
- Joined: Wed May 05, 2010 1:24 am
Could u please clarify below pointschulett wrote:As noted, if you 'cd' to the Project directory in question, you don't need the LOGTO. Otherwise, just do both commands in the same dssh session with a proper delimiter between them. Semi-colon ...
where i need to mention 'cd' to the Project directory i mean after 1 or 2 step etc ?
1)Go to DSEngine directory
2)fire: . ./dsenv
3)bin/uvsh
4)LOGTO Project_Name
5)fire query: SELECT JOBNO FROM DS_JOBS WHERE NAME='JobName'
2)could you Please elaborate on the below point
Just do both commands in the same dssh session with a proper delimiter between them
-
- Participant
- Posts: 14
- Joined: Wed May 05, 2010 1:24 am
Hi Vamsi,
Thanks for your participation.
Actually my requirement is not to find out total number of jobs in a project, but it is to find out the job number which is associated with a Job.
Chulett,
I have tried to find out the path where dssh might be stored but as displayed below it is not present.
bash-2.05b$
bash-2.05b$ whereis dssh
dssh:
bash-2.05b$
Thanks for your participation.
Actually my requirement is not to find out total number of jobs in a project, but it is to find out the job number which is associated with a Job.
Chulett,
I have tried to find out the path where dssh might be stored but as displayed below it is not present.
bash-2.05b$
bash-2.05b$ whereis dssh
dssh:
bash-2.05b$
-
- Participant
- Posts: 14
- Joined: Wed May 05, 2010 1:24 am
Hi Team,
I have found out one more thing. This might help.
I went into the bin directory of DSEngine.
Please find the directory structure, you can find dssh:
-rwxr-x--x 1 twdsadmp twdsadmp 1379 Oct 14 2008 pi.t1conv
-rwxr-x--x 1 twdsadmp twdsadmp 3265 Oct 14 2008 pi.prepisys
-rwxr-x--x 1 twdsadmp twdsadmp 8330 Oct 14 2008 pi.cvtacc
-rwxr-xr-x 1 twdsadmp twdsadmp 101349 Nov 3 2008 dssearch
lrwxrwxrwx 1 root system 56 Mar 31 2009 dssh -> /tahtidsdatap/InformationServer/Server/DSEngine/bin/uvsh
-rwsr-x--x 1 root system 1763689 Mar 31 2009 load_NLS_shm
-rwxr-xr-x 1 twdsadmp twdsadmp 2201577 Dec 3 2009 nbasic
-rwxr-xr-x 1 twdsadmp twdsadmp 40520 Dec 3 2009 dsrpcd
-rwxr-xr-x 1 twdsadmp twdsadmp 1793465 Dec 3 2009 shmtest
Here, when I try to execute dssh, it displays following statement:
This directory is not set up for DataStage.
Would you like to set it up (Y/N)?
I have found out one more thing. This might help.
I went into the bin directory of DSEngine.
Please find the directory structure, you can find dssh:
-rwxr-x--x 1 twdsadmp twdsadmp 1379 Oct 14 2008 pi.t1conv
-rwxr-x--x 1 twdsadmp twdsadmp 3265 Oct 14 2008 pi.prepisys
-rwxr-x--x 1 twdsadmp twdsadmp 8330 Oct 14 2008 pi.cvtacc
-rwxr-xr-x 1 twdsadmp twdsadmp 101349 Nov 3 2008 dssearch
lrwxrwxrwx 1 root system 56 Mar 31 2009 dssh -> /tahtidsdatap/InformationServer/Server/DSEngine/bin/uvsh
-rwsr-x--x 1 root system 1763689 Mar 31 2009 load_NLS_shm
-rwxr-xr-x 1 twdsadmp twdsadmp 2201577 Dec 3 2009 nbasic
-rwxr-xr-x 1 twdsadmp twdsadmp 40520 Dec 3 2009 dsrpcd
-rwxr-xr-x 1 twdsadmp twdsadmp 1793465 Dec 3 2009 shmtest
Here, when I try to execute dssh, it displays following statement:
This directory is not set up for DataStage.
Would you like to set it up (Y/N)?
-
- Premium Member
- Posts: 730
- Joined: Tue Nov 04, 2008 10:14 am
- Location: Bangalore
-
- Premium Member
- Posts: 730
- Joined: Tue Nov 04, 2008 10:14 am
- Location: Bangalore
-
- Participant
- Posts: 14
- Joined: Wed May 05, 2010 1:24 am
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
It doesn't matter what it's a link to. It's there.
Always answer "Would you like to set it up?" in the negative.
Always answer "Would you like to set it up?" in the negative.
Code: Select all
cd $ProjectDir
DSHOME=`cat /.dshome`
export DSHOME
$DSHOME/bin/dssh "SELECT COUNT(*) FROM DS_JOBS;"
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.