Page 1 of 1

Getting the Director list of executed jobs

Posted: Mon Aug 06, 2007 12:47 pm
by gpbarsky
Hola mis amigos....

I need to know how can I do to get (by means of e job) the executed jobs listed in the Director screen. Take into account that my application uses the invocation id, so, there are several occurrences of the same job in the Director screen (JOBA.ID1, JOBA.ID2, etc.).

Any help will be appreciated.
:D

Posted: Mon Aug 06, 2007 2:01 pm
by DeepakCorning
I am not sure if there is a process for it for not but this is what I used to do as a workaround -->

1. Click on the category where these jobs are present in director.
2. Sort by status.
3. Select all the jobs.
4. Click on print and print summary to a print file.
5. Open it with Excel and filter out whtvr u want.

Its kind of long and lil messy method :D

Posted: Mon Aug 06, 2007 2:09 pm
by gpbarsky
Thanks, but what I really need is to hace a job running, and each 5 minutes to look at the list of executed jobs, to analyze if some of them is in Aborted status. This should be done automatically by a job running in background, and when an Aborted job is detected, a note should be sent to me.

What I don't know how to do is to get the list of executed jobs.

I hope this can clarify.
:wink:

Posted: Mon Aug 06, 2007 2:17 pm
by ray.wurlod
You have filters available in the Director.
You can also disable the display of Category (in the View menu) then sort by Status - this will bring all the Aborted jobs to the top, and group all the Finished jobs together.

Posted: Mon Aug 06, 2007 2:29 pm
by gpbarsky
Obviously is not clear what I need.

I don't want to look at the Director screen.

I want to have a job, running and detecting automatically when an Aborted job appears. So, this job should retrieve the list of run jobs, and analyze the status of each job.

Is it enough ?

Posted: Mon Aug 06, 2007 2:47 pm
by ray.wurlod
Read your original post, which explicitly mentions the Director screen.

Yes, this can readily be done in a job, but that job would include custom code. It can not be done with a server job alone, because there is no single source of data; every job has a separate set of hashed files containing its run-time (process) metadata. Use the DataStage API functions in a job control or a before-stage subroutine to generate the data to process.

Posted: Mon Aug 06, 2007 2:53 pm
by gpbarsky
Ray:

I apologize by the text of the original note. May be my translation to english was no good.

Can you tell me which DS tables should be included in the process that analyzes the running jobs ?

Thanks in advance.

Posted: Mon Aug 06, 2007 4:20 pm
by ArndW
The routines you need are DSAttachJob(), DSGetJobInfo() and DSDetachJob(). I would prefer doing completely custom code but you could write a job that reads the DS_JOBS hashed file and for each entry uses the calls listed above to get information about the runs status of jobs and their instances.

Re: Getting the Director list of executed jobs

Posted: Mon Aug 06, 2007 11:06 pm
by sachin1
I agree with ArndW you need to use a custom code mentioned, in the JOB PROPERTIES IN JOB CONTROL TAB, and run the job, it will execute the code inside it and you can get a result in mentioned/used log file.

also you can check Ascential Software Corporation routine UtilityRunJob(sdk) may that help you for some information.

Posted: Tue Aug 07, 2007 7:04 am
by gpbarsky
Thanks to everybody who participated in the answer.

I will try the DS* routines.

Have a nice day.
:D

Posted: Tue Aug 07, 2007 2:39 pm
by ray.wurlod
I disagree that it has to be done in job control code. You can use DS_JOBS as source (use a Selection to eliminate control records - those that have "/" or "\" as their first character) and create routines to extract the relevant information. Much more GUI.