Get -jobinfo listing for jobs called by a sequence job

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
rdy
Participant
Posts: 38
Joined: Wed Nov 05, 2003 2:40 pm

Get -jobinfo listing for jobs called by a sequence job

Post by rdy »

I have a DS sequence job that controls the overall job flow for a complex DS process. It in turn calls additional sequence jobs that finally execute server jobs.

I would like to be able to get the job status using the dsjob -jobinfo command for all the sub-jobs that are executed by my master job and down the line. But I don't want to have to keep track of the job names in my script file - I'm hoping that DS keeps track of which jobs are executed by another.

Question:

Is there a way for me to get the jobinfo for all the jobs that are executed from a master job? Maybe by calling the command recursively somehow?
ogmios
Participant
Posts: 659
Joined: Tue Mar 11, 2003 3:40 pm

Re: Get -jobinfo listing for jobs called by a sequence job

Post by ogmios »

No. No possible way

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

Post by chulett »

I would certainly think you can. I've done it in a routine so I assume something similar can be done in a script. Don't have time right now for a long-winded explanation, but you are on the right track...

Use the equivalent of DSGetLogSummary to get the log messages from the Sequencer Job run. Loop thru the output looking for relevant messages, I looked for the "Job xxxxxx has finished" messages to farm job names and statuses. You can then take the list of found job names and go get information from their log, if the information you need isn't included in the Sequencer Job's log.

Would be easier in a routine...
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The problem with Craig's approach is it only picks up the jobs that are actually run. If a job was not run, because of some conditional in the sequence, checking the log won't find it.

The only "solution" would involve knowledge of the metadata underneath a job sequence. This has not been published so is not in the public domain (though it could be "hacked").
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The use of -jobinfo in the topic suggests that you want to do this within the dsjob command line interface.

Source code for dsjob exists (see Appendix A of the Server Job Developer's Guide) so, if you had figured out how to extract the information you need from the Repository (but see my previous post), you could customize dsjob to your own requirements.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

That's true and I probably should have pointed that out. I was specifically looking for the status and other bits of information from jobs that actually ran, typically looking for errors. If, as Ray mentioned, a job was branched around or for any other reason not executed, you wouldn't find it that way... but it satisfied my needs and seemed like it may help in the hunt for other ways to accomplish this task. :)
-craig

"You can never have too many knives" -- Logan Nine Fingers
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

I just posted the code to stop all the jobs in a sequence yesterday. The same code could be used to call the get job info routine.
Mamu Kim
rajeev_prabhuat
Participant
Posts: 136
Joined: Wed Sep 29, 2004 5:56 am
Location: Chennai
Contact:

Post by rajeev_prabhuat »

Hi Kim,

I am using the routine code that you had given in your site to generate the short desc of the log and Last warning of the job, how do we get the data or where do you write this data to, so that i can take it and use it. Are you writing the data to a file to some other table.

Regards,
Rajeev Prabhu
kduke wrote:I just posted the code to stop all the jobs in a sequence yesterday. The same code could be used to call the get job info routine.
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

All the transformation routines just return Ans. Most do not write the results to a file. You would need to add that functionality. If it was me then I would write it to a hash file. I would then run a job and push the results to a table in the data warehouse.

If you did this in a shell script then you can get the jobs in a sequence with SQL.

Code: Select all

SELECT 
   EVAL "TRANS('DS_JOBOBJECTS','J\':@RECORD<5>:'\ROOT',31,'X')" AS JOBS FMT '35L'
FROM 
   DS_JOBS
WHERE
   EVAL "if TRANS('DS_JOBOBJECTS','J\':@RECORD<5>:'\ROOT',40,'X') = '2' then 'Y' else 'N'" = 'Y'
   AND NAME = 'MySeqName'
;

You could process this with the uvsh command. I would get rid of the multiple lines. You could then read these one at a time.
Mamu Kim
Post Reply