Page 1 of 1

JobList in job sequencer

Posted: Tue Mar 18, 2003 10:37 am
by MAT
Hello all,

Does anyone know if it is possible to obtain a list containing names of the job activities within a job sequencer using BASIC functions?

Thanks

MAT

Posted: Tue Mar 18, 2003 4:59 pm
by ariear
Hi,

I think that what you need is a small recusive function that starts with the Sequencer itself and checks every job activity in it. Remember that a job activity in a Sequencer can be another Sequencer Or batch. You have all the needed functions in BASIC (DSGetJobInfo etc)

Ariear

Posted: Tue Mar 18, 2003 7:38 pm
by ray.wurlod
Would you like to expand on your design?

What InfoType option(s) would you use with DSGetJobInfo? Would you propose inspecting the sequence's generated code; if so, do you know where and how to find it? And, even if you can do this, jobs are attached using DSAttachJob, would you parse the source code for occurrences of this?

Just for once I don't have an immediate answer, but I am fairly certain it can not be done with existing DataStage functions. Generating the job hierarchy in a report is something that would be really useful on my current project, where we have five levels of hierarchy.


Ray Wurlod
Education and Consulting Services
ABN 57 092 448 518

Posted: Wed Mar 19, 2003 8:10 am
by MAT
What I am trying to do here is to generate a full report about a sequencer. We have to do this because even if my team is developping the entire project, we are not the ones who will be watching over the servers when DataStage runs it. Production guys will need to know quickly what is going wrong (if anything happens to go wrong). Since a sequencer is running every job it can (even if a job aborts, it does not treat it as an error), I would like to scan the specific jobs logs for warnings and errors. I can scan through logs (DSGetLogSummary() and others) but I need a list of my job's name to call DSAttach for every job before I can scan any logs. I know I could import the sequencer log in a routine, search the text for the name of jobs after a DSRun but it seems a twisted way of getting infos about my sequencer. Anyway, if Ray says I can't do it with BASIC, I'm not going to argue [;)]. Thanks for taking some time to reply to my post guys, if I find a way to do it, I'll let everyone know.

regards

MAT

Posted: Wed Mar 19, 2003 4:08 pm
by ariear
Hi,

My initial design is a recursive routine that will get as a parameter a jobname (The initial one will be the sequencer name), will scan all the jobs in the project to see if this job is a controlling job of others and if so scan each one of them. many variations can be done with this design like moving the project's list of job as a parameter each time the routine is called (Need to find the jobs only once) or create a hirarchical list of jobs and the controllers ...
Of course the moment a job is recognized as controlled by the sequencer it's status can be captured....But the problem is that some job activities were not activated at this run according to some sequencing condotion , a way of picking only the jobs that were activated should be found

Ariear

Posted: Wed Mar 19, 2003 10:35 pm
by ray.wurlod
Just to clarify, I didn't say it can't be done in DataStage BASIC. What I said was that it can't be done (afaik) using existing DataStage functions. There is a "peeking under the covers" solution.

Out of curiosity, have you tried the DSMakeJobReport function on your sequence?

Posted: Thu Mar 20, 2003 1:12 pm
by MAT
Hi,

Yes, I tried using DSMakeJobReport. Datastage tells me the job has no stages, I only get start time, end time but nothing about job logs. The only way I've found is by using DSGetLogSummary and filtering the array afterwards.
Finally, I decided to "hardcode" the names of my jobs in a variable and then scan each logs. Not very brilliant, but at least it works.

MAT

Posted: Thu Mar 20, 2003 10:21 pm
by ray.wurlod
There is a similar requirement at my current project, but they want to be able to do this documentation from design-time metadata, which rules out the option of going via the log files. In any case, the log files would be unreliable, because some jobs run every day, others only once per week, and a small few only once per month. Could never guarantee to have them all! [:(]