Page 1 of 1

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

Posted: Tue Nov 01, 2005 2:29 pm
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.

Posted: Tue Nov 01, 2005 2:32 pm
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.

Posted: Tue Nov 01, 2005 2:47 pm
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.

Posted: Tue Nov 01, 2005 3:03 pm
by Ultramundane
Thanks. I had to change uv to uvsh because of load errors. But that works awesome.

Thanks.

Posted: Wed Nov 02, 2005 2:50 am
by ray.wurlod
Maybe dssh would be better than uvsh, even though they're presently the same executable.

Posted: Wed Nov 02, 2005 9:22 am
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

Posted: Wed Nov 02, 2005 2:08 pm
by ray.wurlod
Did you mean

Code: Select all

## SOURCE ENVIRONMENT 
. ~/.dsadm
. $DSHOME/dsenv 
or does your dsadm script execute dsenv?

Posted: Wed Nov 02, 2005 11:04 pm
by Ultramundane
My .dsadm environment file sources dsenv.

Thanks.

Posted: Wed Apr 05, 2006 3:05 pm
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.

Posted: Thu Apr 06, 2006 12:32 am
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.