How to run UV commands from Unix

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

zulfi123786
Premium Member
Premium Member
Posts: 730
Joined: Tue Nov 04, 2008 10:14 am
Location: Bangalore

How to run UV commands from Unix

Post 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
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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?
-craig

"You can never have too many knives" -- Logan Nine Fingers
zulfi123786
Premium Member
Premium Member
Posts: 730
Joined: Tue Nov 04, 2008 10:14 am
Location: Bangalore

Post 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
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Sreenivasulu
Premium Member
Premium Member
Posts: 892
Joined: Thu Oct 16, 2003 5:18 am

Post by Sreenivasulu »

good info.. craig.
i used to go to DSHOME always

Regards
Sreeni
zulfi123786
Premium Member
Premium Member
Posts: 730
Joined: Tue Nov 04, 2008 10:14 am
Location: Bangalore

Post 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?
zulfi123786
Premium Member
Premium Member
Posts: 730
Joined: Tue Nov 04, 2008 10:14 am
Location: Bangalore

Post by zulfi123786 »

Also In which guide is uvsh discussed in detail? regarding its abilities, syntaxes and features etc......
zulfi123786
Premium Member
Premium Member
Posts: 730
Joined: Tue Nov 04, 2008 10:14 am
Location: Bangalore

Post 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......
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
zulfi123786
Premium Member
Premium Member
Posts: 730
Joined: Tue Nov 04, 2008 10:14 am
Location: Bangalore

Post 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.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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;"
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
atulgoel
Participant
Posts: 84
Joined: Tue Feb 03, 2009 1:09 am
Location: Bangalore, India

Post by atulgoel »

Hi, Some one please let me know how to find the Project Directory? Means how to go to Project Directory in UNIX..
Atul
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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.
Post Reply