Page 1 of 1

Get -jobinfo listing for jobs called by a sequence job

Posted: Tue May 11, 2004 9:01 am
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?

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

Posted: Tue May 11, 2004 9:40 am
by ogmios
No. No possible way

Ogmios

Posted: Tue May 11, 2004 9:57 am
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...

Posted: Tue May 11, 2004 4:01 pm
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").

Posted: Tue May 11, 2004 4:04 pm
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.

Posted: Tue May 11, 2004 4:14 pm
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. :)

Posted: Wed May 12, 2004 7:56 am
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.

Posted: Mon Dec 13, 2004 7:49 am
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.

Posted: Mon Dec 13, 2004 8:45 am
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.