JobList in job 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
MAT
Participant
Posts: 65
Joined: Wed Mar 05, 2003 8:44 am
Location: Montréal, Canada

JobList in job sequencer

Post 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
ariear
Participant
Posts: 237
Joined: Thu Dec 26, 2002 2:19 pm

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

Post 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
MAT
Participant
Posts: 65
Joined: Wed Mar 05, 2003 8:44 am
Location: Montréal, Canada

Post 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
ariear
Participant
Posts: 237
Joined: Thu Dec 26, 2002 2:19 pm

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

Post 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?
MAT
Participant
Posts: 65
Joined: Wed Mar 05, 2003 8:44 am
Location: Montréal, Canada

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

Post 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! [:(]
Post Reply