Page 1 of 1

Getting category list in a project

Posted: Mon Jan 29, 2007 4:19 am
by tom
Hi folks,

Can anybody tell me how to get list of category names in a project from command prompt. I mean for list of projects "dsjob -lprojects" and for list of jobs "dsjob -ljobs". In the same way is there any option to get list of categories in a project.

Please suggest me

Thanks in advance.

Posted: Mon Jan 29, 2007 5:59 am
by jhmckeever
Unfortunately there isn't a "dsjobs -lcategories" option. An easier solution, however, is to use a UV query on the repository:

Code: Select all

SELECT DISTINCT CATEGORY FMT 60 FROM DS_JOBS;
From your project directory you can execute it straight from the command line:

Code: Select all

uv "SELECT DISTINCT CATEGORY FMT 60 FROM DS_JOBS;"
HTH,
J.

Posted: Mon Jan 29, 2007 3:15 pm
by ray.wurlod
Do you want just job categories, or routine, table definition and other categories as well? If the latter, simply execute similar commands on the other Repository tables and form the UNION. For example

Code: Select all

SELECT DISTINCT 'Jobs',CATEGORY FMT '60L' FROM DS_JOBS
UNION
SELECT DISTINCT 'Routines',CATEGORY FROM DS_ROUTINES;

Posted: Tue Jan 30, 2007 7:48 am
by tom
Hi,

I tried uv ""SELECT DISTINCT CATEGORY FMT 60 FROM DS_JOBS;" from the project directory from command prompt. But i got "Command Not Found". Can u please suggest me

Posted: Tue Jan 30, 2007 7:50 am
by DSguru2B
You need to set your dsenv first. Search on how to execute dsenv file. Then run that command. Or simply log onto your DataStage Administrator and run the commad

Code: Select all

SELECT DISTINCT CATEGORY FMT 60 FROM DS_JOBS;
in the command area. Dont forget the trailing semicolon.

Posted: Tue Jan 30, 2007 2:56 pm
by ray.wurlod
You need to set your PATH to include $DSHOME/bin or to specify the full pathname of the uv command.

After that, you may find that you have not executed the dsenv script, which will cause errors about libraries when you manage to execute the uv command.