How can I get the full /path/project list?

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
Ultramundane
Participant
Posts: 407
Joined: Mon Jun 27, 2005 8:54 am
Location: Walker, Michigan
Contact:

How can I get the full /path/project list?

Post by Ultramundane »

It looks like UV.account stores this info. I can see the projects and paths when I do a strings on this file. Is there any other place that is more readable to get this information? Is there a command that can be run to get this information? I can run dsjob -lprojects, but this only lists the projects. I tried to use dsjob -projectinfo <project name>, but this too only lists the name of the project and not the path.

Thanks.
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

DS.TOOLS from any project TCL prompt will get you this information. Do you want programmatic access? If so, READ it out of UV.ACCOUNT and parse, or use the DSExecute API to execute the TCL command to SELECT the file. You can always use the unix command line read to access the file from a shell script.
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Code: Select all

cd $DSHOME && . ./dsenv && bin/uv "SELECT @ID, PATH FMT '60L' FROM UV.ACCOUNT WHERE @ID NOT IN ('UV', 'uv') AND @ID NOT LIKE 'HS.%';" > /tmp/projects
Modify the WHERE clause to suit your requirements.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Ultramundane
Participant
Posts: 407
Joined: Mon Jun 27, 2005 8:54 am
Location: Walker, Michigan
Contact:

Post by Ultramundane »

Thanks. I had to change uv to uvsh because of load errors. But that works awesome.

Thanks.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Maybe dssh would be better than uvsh, even though they're presently the same executable.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Ultramundane
Participant
Posts: 407
Joined: Mon Jun 27, 2005 8:54 am
Location: Walker, Michigan
Contact:

Post by Ultramundane »

With your help Ray I ended up with the following code to get the projects.

Code: Select all

#!/bin/ksh

## SOURCE ENVIRONMENT
. ~/.dsadm

## CHANGE TO Directory Containing the VOC
cd $DSHOME

## GET PROJECT LIST INTO ARRAY
set -A MY_ARRAY $(dssh "SELECT PATH FMT '60L' \
        FROM UV.ACCOUNT \
       WHERE @ID NOT IN ('UV', 'uv', 'DS', 'ds') \
         AND @ID NOT LIKE 'HS.%';" \
| awk '{print $1}' \
| grep '/')

## LOOP COUNTER
typeset -i COUNT=0

## SIZE OF ARRAY
typeset -i ARRCNT=${#MY_ARRAY[*]}

## DISPLAY ARRAY ELEMENTS
while (( $COUNT < $ARRCNT ))
do 
   print "${MY_ARRAY[${COUNT}]}"

   (( COUNT = $COUNT + 1 )) 
done

exit 0
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Did you mean

Code: Select all

## SOURCE ENVIRONMENT 
. ~/.dsadm
. $DSHOME/dsenv 
or does your dsadm script execute dsenv?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Ultramundane
Participant
Posts: 407
Joined: Mon Jun 27, 2005 8:54 am
Location: Walker, Michigan
Contact:

Post by Ultramundane »

My .dsadm environment file sources dsenv.

Thanks.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Welcome aboard. :D

Not dssh.exe on UNIX, just plain dssh - and you probably want to specify exactly the fields from UV_SCHEMA (or UV_ACCOUNT) that you want in the output - for example, you are probably not interested in the numeric ID of the owner or creator.

I prefer to give SQL syntax, even though I am fully aware that there is another query language available, because most folks are more familiar with SQL.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

The same will be displayed in adminstrator client.
If you select a project from Projects tab, bottom of the client will show you the Project pathname.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
Post Reply