Job Sequence

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
rohitchattar
Premium Member
Premium Member
Posts: 24
Joined: Thu Jun 21, 2007 1:20 am

Job Sequence

Post by rohitchattar »

Hi,

I have to develop the job sequence which checks in the dependency with the first job data.

I have only two jobs in my sequence.

Job A loads the data in to table. If count is more then 0 in the table then only i have to run job B otherwise I have to quiet from sequence.

Please suggest
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

In between your two Job activities place a Routine activity that interrogates Job1 for its row count. A trigger based on the routine's return value can determine whether to execute Job2. If this trigger does not fire, then Job2 does not get executed and the sequence completes.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ag_ram
Premium Member
Premium Member
Posts: 524
Joined: Wed Feb 28, 2007 3:51 am

Post by ag_ram »

Maybe another solution,

Creation of Server routine is neccessary and which can be better invoked from After-Job Subroutine option of the Job JobA, by aborting the job if the condition is met.

Server Routine logic:
If the particular link has zero linkcount, then abort the Job, otherwise return 0.

Now the Job Sequence has only two Job Activities with the proper trigger setting in the Job JobA.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

There you go. I have a philosophical objection to writing jobs to abort.

But that's just me. Control freak. Must retain control under all circumstances.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ag_ram
Premium Member
Premium Member
Posts: 524
Joined: Wed Feb 28, 2007 3:51 am

Post by ag_ram »

Ray,

[quote="ray.wurlod"]I have a philosophical objection to writing jobs to abort. [quote]

Can you please share your valid points against the intention of aborting a Job unneccesarily so that we can also include that rule as a best practice?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

ray.wurlod wrote:... that's just me. Control freak. Must retain control under all circumstances.
It's not necessarily a best practice, but I've been around since before version 1.0, when there was no such thing as automatic reset or recovery from aborted jobs. And I just don't think it's the cleanest way to code, irrespective of the tool you use. If I can create a job that is known not to generate warnings and errors, I can eliminate consideration of the job as the cause of the error, and concentrate on the data and/or the hardware.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply