Get All Jobs in a Particular Sequencer

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
MichaelMathers
Participant
Posts: 2
Joined: Thu Dec 18, 2003 12:47 pm

Get All Jobs in a Particular Sequencer

Post by MichaelMathers »

I am trying to write a Routine that needs that needs to dynamically get all the Job names within a Job Sequencer.

Say we have three Activities within the Sequencer. The first is a RoutineActivity. The other two Activities are normal Job Activities.

The Routine needs to first get it's Controller name (the Job Sequence). This part I got. Then it needs to get every job Controlled by that Job Sequence (so I can Attach to them). It does not need to descend down multiple levels of abstraction. The immediately controlled jobs is all I need. Is there any way to do this?

Michael Mathers
Apollo Group, Inc.
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

The easiest is thru reverse engineering. Thru simple inspection the Inner Circle crowd has mapped the internals to DS_JOBOBJECTS hash file. This contains all of the design information. This is the worst option available, but guarantees 100% accuracy for your given release of DataStage.

There are API's that you can use to ask jobs what their active stages are, and the list of links within the job. There are no other API's that would do what you want.

MetaStage is after-the-fact. What you need is an API that inspects job designs, namely a sequencer job, and returns exactly what you need. I suggest you contact Kim Duke directly, because he is a wizard at this stuff and can get you what you need. If Kim can't do it, then Ray, Mike Hester, Mike Fortuna, and myself are very familiar with this have done it before, or already have existing libraries that can be adapted. We try not to give this stuff away freely.

This is not for the faint of heart. If you do not know Universe, DS BASIC, and the internals of DataStage, than I believe this task is beyond most people. If you understand Universe and DS BASIC, then the hash file DS_JOBOBJECTS is your starting point, reverse engineer from there!

Good luck!
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

Michael

Dependent jobs are stored in field 31 of the ROOT record in DS_JOBOBJECTS. Field 32 has a 0 if it is a job and not a routine. These fields are multivalued. If you need more than that for a couple hundred I will write most of it.
Mamu Kim
MichaelMathers
Participant
Posts: 2
Joined: Thu Dec 18, 2003 12:47 pm

Post by MichaelMathers »

Thank you for your responses.

I had suspected (incorrectly, obviously) that this was easier than it appears. I may try to do this myself or possibly take up Kim's offer at a later date.

Thanks, again.

Michael
dickfong
Participant
Posts: 68
Joined: Tue Apr 15, 2003 9:20 am

Post by dickfong »

If your jobs has been ran at least once, you can simply execute dsjob command with -jobinfo parameters to all your jobs. Then write a little script to grep for the "Job Controller" and you shall get all the jobs called by the given controller (sequencer). Hope that helps :wink:
Post Reply