Page 1 of 1

Job Sequence

Posted: Wed Apr 23, 2008 12:54 am
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

Posted: Wed Apr 23, 2008 1:58 am
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.

Posted: Wed Apr 23, 2008 3:18 am
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.

Posted: Wed Apr 23, 2008 3:33 am
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.

Posted: Wed Apr 23, 2008 3:50 am
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?

Posted: Wed Apr 23, 2008 6:51 am
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.