Page 1 of 2

How to run UV commands from Unix

Posted: Wed Dec 23, 2009 1:12 am
by zulfi123786
uvsh is used to run UV queries (Please correct if wrong)

Well i am getting the following error

==> uvsh
DataStage Command Language 7.5
Copyright (c) 1997 - 2004 Ascential Software Corporation. All Rights Reserved
bin logged on: Wed Dec 16 03:37:41 2009

>SELECT * FROM DS_JOBS WHERE NAME LIKE 'djpLODDailyApNum'
Retrieve: syntax error. Unexpected sentence without filename. Token was "".
Scanned command was SELECT * FROM 'DS_JOBS' WHERE 'NAME' LIKE 'djpLODDailyApNum'


Please Advice

Posted: Wed Dec 23, 2009 7:55 am
by chulett
Where did you launch uvsh from? Did you get any kind of a message about something "not being set up"? Are you properly logged into your project? Does that work in the Administrator?

Posted: Wed Dec 23, 2009 10:37 am
by zulfi123786
oooops............

was checking that in the development environment not sure why i did not get the error you mentioned. In other environment i am facing this

$ uvsh
This directory is not set up for DataStage.
Would you like to set it up (Y/N)?

so could you please share how to run the above UV query from unix

Posted: Wed Dec 23, 2009 10:52 am
by chulett
Because someone already screwed up and said "Yes" in dev. :?

Always answer that question "no", it means you're in the wrong place. Always launch "uvsh" or "dssh" from one of two places - $DSHOME or inside a project directory. For the latter you're good to go, for the former you'll need to LOGTO your project name before you issue any sql.

Posted: Sat Dec 26, 2009 11:02 am
by Sreenivasulu
good info.. craig.
i used to go to DSHOME always

Regards
Sreeni

Posted: Sat Jan 16, 2010 6:09 am
by zulfi123786
Thank you. Now i am able to launch uvsh from $DSHOME but i am could any one help me with what is next step to run the uv query.

do i need to log on to the project after issuing uvsh? if yes how? or do i need to log on to the project before issuing uvsh?

Posted: Sat Jan 16, 2010 6:14 am
by zulfi123786
Also In which guide is uvsh discussed in detail? regarding its abilities, syntaxes and features etc......

Posted: Sat Jan 16, 2010 6:47 am
by zulfi123786
Now it seems i made a small Advance. wanted to run "select * from DS_JOBS"

1) Entered into the $DSHOME
2) Sourced the dsenv file
3) Ran $DSHOME/bin/uvsh "select * from DS_JOBS;"

Got the result :

vhrldct05:/opt/tools/ds/Ascential/DataStage/DSEngine/bin
==> $DSHOME/bin/uvsh "select * from DS_JOBS;"
DataStage/SQL: Table "DS_JOBS" does not exist.

Now I am confused......

Posted: Sat Jan 16, 2010 8:45 am
by chulett
That's because you are sitting in the Engine directory rather than a Project. Add a step "2.5" where you cd to the Project directory you want to check. Note you could also try adding a "LOGTO <ProjectName>" command to the beginning of the commands you run in Step 3.

Posted: Sat Jan 16, 2010 2:37 pm
by ray.wurlod
Do stop thinking of it as UniVerse. DataStage ceased being UniVerse in version 6.0. Prefer dssh as the command to enter the DataStage shell.

Otherwise the story is the same. But if you ever work in a site where UniVerse and DataStage are both installed, the difference is critical. And they ARE different.

Posted: Wed Jan 20, 2010 1:56 am
by zulfi123786
When it is run from the Project Directory it is working fine but loging on to the project using

uvsh "LOGTO dpr_hbus_dev"

from any directory other than project dir it is not working, any help would be greatly appreciated.

Posted: Wed Jan 20, 2010 4:46 am
by ArndW
There is another problem with your command. the "SELECT" verb also exists with the DataStage query language and DS detects the different flavours (DS syntax or SQL syntax) by looking for a ";" terminator in the command, if that is not present then it is assuming the standard DataStage syntax. If you add a semicolon then the command might work.

Posted: Wed Jan 20, 2010 5:25 am
by ray.wurlod
Execute $DSHOME/dsenv from wherever you are.

Change directory to the project directory.

From there execute $DSHOME/bin/dssh "SELECT * FROM DS_JOBS;"

Posted: Thu Jul 28, 2016 9:25 pm
by atulgoel
Hi, Some one please let me know how to find the Project Directory? Means how to go to Project Directory in UNIX..

Posted: Fri Jul 29, 2016 2:27 am
by ArndW
This:

Code: Select all

$DSHOME/bin/dssh "LIST UV.ACCOUNT @ID PATH ID.SUP"

will give you a list of the projects from the command line, or you can see the list of projects and paths from the administrator client.