Abort the Sequence as soon as job logs 1 warning

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

poorna_76
Charter Member
Charter Member
Posts: 190
Joined: Thu Jul 08, 2004 10:42 am

Abort the Sequence as soon as job logs 1 warning

Post by poorna_76 »

Hi All,

I have 5 jobs running through the Sequence , one after the other.

I would like the Sequence to abort as soon as JOB1 logs 1 warning message (MetaData mismatch error/Data truncation error).
How should I do this in Sequence?


I have done this in JobControl by using DSSetJobLimit & DSGetJobInfo functions, very easily.

I would like to do the same in the Sequence. How would i do that?

Thanks in Advance.
kris007
Charter Member
Charter Member
Posts: 1102
Joined: Tue Jan 24, 2006 5:38 pm
Location: Riverside, RI

Post by kris007 »

IMO it's not possible to abort the sequence as soon as any Job logs the first warning message. You can abort the sequence when any job finishes with warnings.
Kris

Where's the "Any" key?-Homer Simpson
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Post by narasimha »

Give this a try

Set the Trigger on JOB1 as OK - (Conditional), this way if JOB1 gets even 1 warning, it will abort the sequence.
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
poorna_76
Charter Member
Charter Member
Posts: 190
Joined: Thu Jul 08, 2004 10:42 am

Post by poorna_76 »

kris007 wrote:IMO it's not possible to abort the sequence as soon as any Job logs the first warning message. You can abort the sequence when any job finishes with warnings.

In other words, i would like to set the job limit to "Abort after 1 warning",
for all the jobs in the Sequence.

How do i do that?


Thanks in Advance.
poorna_76
Charter Member
Charter Member
Posts: 190
Joined: Thu Jul 08, 2004 10:42 am

Post by poorna_76 »

narasimha wrote:Give this a try

Set the Trigger on JOB1 as OK - (Conditional), this way if JOB1 gets even 1 warning, it will abort the sequence.
Thanks Narasimha.

NO, this did not work.
kris007
Charter Member
Charter Member
Posts: 1102
Joined: Tue Jan 24, 2006 5:38 pm
Location: Riverside, RI

Post by kris007 »

But again, the sequence will abort only after the Job1 finishes with warnings because, the warnings produced by Job1 are written to the log of Job1 and not to the log of the Sequence. Even if you set the Job sequence warning limit to 1, it won't be able to read the warnings produced by Job1 until job1 finishes. So..
Kris

Where's the "Any" key?-Homer Simpson
kris007
Charter Member
Charter Member
Posts: 1102
Joined: Tue Jan 24, 2006 5:38 pm
Location: Riverside, RI

Post by kris007 »

Let me ask you one more question. When you say the Job1 aborts as soon as it logs its first warning, do you mean as soon as it encounters any rejects or is it just any other warning. If you can explain about this, may be we can have a solution in hand.
Kris

Where's the "Any" key?-Homer Simpson
thumsup9
Charter Member
Charter Member
Posts: 168
Joined: Fri Feb 18, 2005 11:29 am

Post by thumsup9 »

In the first job activity use Warning _ Conditional as Trigger and send this link to Routine Avtivity where you can call routine rtLogFatal.

or you can set Warning Limit to 1 in the Job Run Properties of Director.
meena
Participant
Posts: 430
Joined: Tue Sep 13, 2005 12:17 pm

Post by meena »

Hi,
In run job option/Limit/Warnings/Abort job after(01).Are you looking for this or anything else..
In other words, i would like to set the job limit to " Abort after 1 warning ",
for all the jobs in the Sequence.

How do i do that?
thumsup9
Charter Member
Charter Member
Posts: 168
Joined: Fri Feb 18, 2005 11:29 am

Post by thumsup9 »

thumsup9 wrote:In the first job activity use Warning _ Conditional as Trigger and send this link to Routine Avtivity where you can call routine rtLogFatal.

or you can set Warning Limit to 1 in the Job Run Properties of Director.
You can create your own outine of Type Transform function as below

Call DSLogFatal("One or more jobs failed due to Warnings", Arg1)
Ans = 1

and call this in your routine activity.
kris007
Charter Member
Charter Member
Posts: 1102
Joined: Tue Jan 24, 2006 5:38 pm
Location: Riverside, RI

Post by kris007 »

thumsup9 wrote:
thumsup9 wrote:In the first job activity use Warning _ Conditional as Trigger and send this link to Routine Avtivity where you can call routine rtLogFatal.

or you can set Warning Limit to 1 in the Job Run Properties of Director.
You can create your own outine of Type Transform function as below

Call DSLogFatal("One or more jobs failed due to Warnings", Arg1)
Ans = 1

and call this in your routine activity.
Doesn't help. The main sequence will still abort only after Job1 finishes with warnings and the main sequence gets the status of Job1.
Kris

Where's the "Any" key?-Homer Simpson
poorna_76
Charter Member
Charter Member
Posts: 190
Joined: Thu Jul 08, 2004 10:42 am

Post by poorna_76 »

kris007 wrote:Let me ask you one more question. When you say the Job1 aborts as soon as it logs its first warning, do you mean as soon as it encounters any rejects or is it just any other warning. If you can explain about this, may be we can have a solution in hand.
If i run the job individually, i can set the job limit to 1.
When the job encounters 1 warning, it aborts.

Now since i am running the job through Sequence, i don't have control to set the job limit.

I would like to do the same thing while running the job through the Sequence too.

Hope it is clear now.

Thanks in Advance.
poorna_76
Charter Member
Charter Member
Posts: 190
Joined: Thu Jul 08, 2004 10:42 am

Post by poorna_76 »

thumsup9 wrote:In the first job activity use Warning _ Conditional as Trigger and send this link to Routine Avtivity where you can call routine rtLogFatal.

or you can set Warning Limit to 1 in the Job Run Properties of Director.
Thanks thumsup9.

This does not help.
kris007
Charter Member
Charter Member
Posts: 1102
Joined: Tue Jan 24, 2006 5:38 pm
Location: Riverside, RI

Post by kris007 »

No. I have already understood that part. My question is why would a job finish with warnings in your case. Is it because, you are collecting rejects through a reject link and hence it finishes with warnings or you just want to be very very careful that you want it to abort as soon as it logs it first warning. What is your exact requirement? Why is it that you want it to abort after the very first warning message? Besides, the limit you can set in the Director is only during runtime. You can't achieve that while you schedule the job except you set it Project wide.
Kris

Where's the "Any" key?-Homer Simpson
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

poorna_76 wrote:Now since i am running the job through Sequence, i don't have control to set the job limit.
Sure you do... or at least you should. If you run the Sequence job itself with a Warning Limit of 1 it should pass that limit to all child jobs it runs automatically. As noted, it's supposed to be as easy as that.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply