Page 1 of 2

How to list the Job names under the category?

Posted: Mon Apr 02, 2007 5:10 pm
by videsh77
Hi

For a given a category name I want to list the job names under that particular category. How we can achieve this task using universe shell?

regards,

Posted: Mon Apr 02, 2007 5:24 pm
by chulett
Most brain dead way:

Code: Select all

SELECT NAME FROM DS_JOBS WHERE CATEGORY = 'YourCategory';
You'll get one extra record for the category itself, can't remember the magical syntax to exlude that from the list. I'm sure it will be along shortly. :wink:

Posted: Mon Apr 02, 2007 10:07 pm
by ray.wurlod

Code: Select all

SELECT NAME FROM DS_JOBS WHERE CATEGORY = '<<Category name>>' AND NAME NOT LIKE '\\%';

Posted: Tue Apr 03, 2007 7:31 am
by chulett
Doh! And here I thought you needed some of that goofy 'matches' syntax for this. That was too simple. :lol:

Posted: Tue Apr 03, 2007 8:11 am
by just4geeks
ray.wurlod wrote:

Code: Select all

SELECT NAME FROM DS_JOBS WHERE CATEGORY = '<<Category name>>' AND NAME NOT LIKE '\\%';
Where does one execute this command? Thanks....

Posted: Tue Apr 03, 2007 8:14 am
by DSguru2B
In datastage administrator or from unix by going into uv command prompt and logging onto your project.

Posted: Tue Apr 03, 2007 10:45 am
by videsh77
Yes the command provided listing the jobs under any particular category. But if any other categories are under this category, it is not able to list the jobs under them.

How can we list the jobs recursively under categories for a provided category.

Posted: Tue Apr 03, 2007 12:05 pm
by videsh77
We can get those by

select NAME from DS_JOBS where CATEGORY like '<Category Name>%'

Posted: Tue Apr 03, 2007 12:14 pm
by gateleys
videsh77 wrote:We can get those by

select NAME from DS_JOBS where CATEGORY like '<Category Name>%'
I don't think so. :?:

Posted: Tue Apr 03, 2007 12:59 pm
by videsh77
It seemed to me worked. Yes also if you have filter like ray mentioned -

Code: Select all

NAME NOT LIKE '\\%'
have it in query then, it eliminates some unwanted rows.

Now once I get this listing I am redirecting this to a file. But I have seen the column information is getting wrapped. How to avoid this wrapping of column info?

Posted: Tue Apr 03, 2007 1:29 pm
by DSguru2B
videsh77 wrote:But I have seen the column information is getting wrapped. How to avoid this wrapping of column info?
What do you mean by that? Do you mean the column name, thats just first two lines, you can delete the first two lines.

Posted: Tue Apr 03, 2007 1:31 pm
by DeepakCorning
Even better -

Log on to the Datastage Manager .

Navigate to the category.

Select all the jobs underneath it.

DO Usage Analysis (its under tools).

When the window opens up , say View HTML.

:D

Posted: Tue Apr 03, 2007 2:44 pm
by us1aslam1us
Will that display the job in the sub categories too.

Posted: Tue Apr 03, 2007 4:55 pm
by DeepakCorning
Nope the datastage Manager one will not..it will show only the ones which u selected. :(

Posted: Tue Apr 03, 2007 5:09 pm
by us1aslam1us
Neither does the other one.