Finding the Category for each job.

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
sidharthh
Participant
Posts: 8
Joined: Thu Jul 06, 2006 2:13 am

Finding the Category for each job.

Post by sidharthh »

Hi,
I have a task in my hand where i need to pull out all the Job name from the repository sorted on the recent Job run and i need to associate the job name against the category in which they are available. I know that using DSGETJOBINFO and DSPROJECT i can get the entire job details and its last run information. But i am not sure how to find the category name in which the job is present.

I am looking for something of this sort,

Job1,Its Last Runtime,CategoryName1 in which job Job1 is present
Job2,Its Last Runtime,CategoryName2 in which job Job1 is present
Job3,Its Last Runtime,CategoryName3 in which job Job1 is present

My repository is huge (close to 5000 jobs with many category) and it is a herculean task to manually look into each category to create this report.

Could someone help me in finding a way out.

Thank You,
Regards,
Sidhartha
Sid
BugFree
Participant
Posts: 82
Joined: Wed Dec 13, 2006 6:02 am

Post by BugFree »

Code: Select all

"SELECT CATEGORY FROM DS_JOBS WHERE NAME = 'JobName'
Will get the category name with the hierarchy. Guess you will have to run it using DSExcute().
Ping me if I am wrong...
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Welcome aboard. :D

Job name and category are elements of the DS_JOBS repository 'table'. So something simple like:

Code: Select all

SELECT NAME, CATEGORY FROM DS_JOBS;
will get you a complete list of job names and categories. This can be run from either the Administrator client or from the TCL command line. There are various ways to get this in a file, search the forums for COMO should turn them up. Then you can get that information into a lookup structure if you are building a job to produce some kind of report.
Last edited by chulett on Wed May 14, 2008 8:10 am, edited 1 time in total.
-craig

"You can never have too many knives" -- Logan Nine Fingers
sidharthh
Participant
Posts: 8
Joined: Thu Jul 06, 2006 2:13 am

Post by sidharthh »

Hi,
Thanks for your valuable input.
I did fire the command

Code: Select all

SELECT CATEGORY FROM DS_JOBS WHERE NAME = 'One of my Job name'
. There was an ouputput window with "SQL+" alone and not any record record. Am i missing out any point ?

Cheers,
Sidhartha
Sid
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

add a ";" to the command.
sidharthh
Participant
Posts: 8
Joined: Thu Jul 06, 2006 2:13 am

Post by sidharthh »

Sorry, i had missed out semi-colon (;) to close the query. Its working now.

Thanks a ton,

Cheers,
Sidhartha
Sid
sidharthh
Participant
Posts: 8
Joined: Thu Jul 06, 2006 2:13 am

Post by sidharthh »

Now i have two columns (job name against the category) of my output. Now i need to fetch the last run time information for each job. I know it is there somewhere in the repository.

Is there a way i can know the DS Repository Objects, like ALL_OBJECTS/ALL_TABLES Master Meta-data object in oracle. This would help me to analyze the repository further,

Thanks in advance,

Cheers,
Sidhartha
Sid
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

That information really isn't public knowledge. You are meant to retrieve what you are looking for from the job logs, either via the various 'DSGet' functions provided for use in a job or by using the equivalent options of 'dsjob' scripted from the command line.

For example, I would think a search for 'DSGetLog' would turn up quite a number of conversations on the subject.
-craig

"You can never have too many knives" -- Logan Nine Fingers
sidharthh
Participant
Posts: 8
Joined: Thu Jul 06, 2006 2:13 am

Post by sidharthh »

Thanks guys for all your helping hand.

Cheers,
Sid
Sid
Post Reply