Getting the Director list of executed jobs

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
gpbarsky
Participant
Posts: 160
Joined: Tue May 06, 2003 8:20 pm
Location: Argentina

Getting the Director list of executed jobs

Post 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
Guillermo P. Barsky
Buenos Aires - Argentina
DeepakCorning
Premium Member
Premium Member
Posts: 503
Joined: Wed Jun 29, 2005 8:14 am

Post 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
gpbarsky
Participant
Posts: 160
Joined: Tue May 06, 2003 8:20 pm
Location: Argentina

Post 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:
Guillermo P. Barsky
Buenos Aires - Argentina
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
gpbarsky
Participant
Posts: 160
Joined: Tue May 06, 2003 8:20 pm
Location: Argentina

Post 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 ?
Guillermo P. Barsky
Buenos Aires - Argentina
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
gpbarsky
Participant
Posts: 160
Joined: Tue May 06, 2003 8:20 pm
Location: Argentina

Post 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.
Guillermo P. Barsky
Buenos Aires - Argentina
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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.
sachin1
Participant
Posts: 325
Joined: Wed May 30, 2007 7:42 am
Location: india

Re: Getting the Director list of executed jobs

Post 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.
gpbarsky
Participant
Posts: 160
Joined: Tue May 06, 2003 8:20 pm
Location: Argentina

Post by gpbarsky »

Thanks to everybody who participated in the answer.

I will try the DS* routines.

Have a nice day.
:D
Guillermo P. Barsky
Buenos Aires - Argentina
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply