Potential Issue with DSJS.RUNWARN in Sequence Job

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
jweir
Participant
Posts: 134
Joined: Wed Aug 04, 2010 12:31 pm

Potential Issue with DSJS.RUNWARN in Sequence Job

Post by jweir »

Hi all,

I have a sequence job that contains say 5 parallel jobs. In the fourth parallel job trigger, I have to output links. One link is for a "successful" run, and the other link is for a "failed" run.

For the successful trigger, I have this conditional statement: "DSJS.RUNWARN or DSJS.RUNOK".

However, it happened that when this fourth job ran and failed, the fifth job actually started. This is not something I want. When the fourth job fails, I do not want the fifth job to start.

Now in the Director log, I do see that this fourth job threw warnings. Now my question is: Even if the job fails and has warnings in the job log, does the 'DSJS.RUNWARN' make the sequence job move on to the next job?

Thanks in advance.
Jweir

--- If strength were all, tiger would not fear scorpion.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

RUNWARN means "finished with warnings" so it would have to "succeed" but have warnings rather than actually ABORT for the trigger to pass control thru.

One suggestion - if you have two triggers and one should go forward and everything else should stop, I always used "Otherwise" on the latter so I didn't have to list out all of the things not covered by the former.
-craig

"You can never have too many knives" -- Logan Nine Fingers
jweir
Participant
Posts: 134
Joined: Wed Aug 04, 2010 12:31 pm

Post by jweir »

Thanks for the quick reply chulett.

I am not a premium member, so I cannot see your entire answer. However, I am thinking you are confirming my beliefs that DSJS.RUNWARN can allow the sequence to continue even if the job is aborted when the job has warnings.

I would think the safest route with have the custom trigger read something like:

Code: Select all

JOB_ACTIVITY_NAME.$JobStatus < 3
Jweir

--- If strength were all, tiger would not fear scorpion.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I opened it up, hopefully it helps.
-craig

"You can never have too many knives" -- Logan Nine Fingers
rbk
Participant
Posts: 23
Joined: Wed Oct 23, 2013 1:10 am
Location: India

Post by rbk »

hi jweir,
I think Craig meant that the DSJS.RUNWARN definitely needs the job to succeed and have warnings to pass through.

If the job had aborted with warnings, there is no way for the trigger to get activated.

Can you please re-validate your trigger conditions ?
Cheers,
RBK
jweir
Participant
Posts: 134
Joined: Wed Aug 04, 2010 12:31 pm

Post by jweir »

Thanks.

If you are saying the RUNWARN has to succeed in order for it to move forward, then something else must be at play. My current trigger for the 'success' link was:

Code: Select all

DSJS.RUNWARN or DSJS.RUNOK
And for my 'failed' link was just the Expression Type 'Failed' option.

So then my question still remains then. How can this setup produce the results I was seeing?

I made a test and put the 'success' link with this code:

Code: Select all

JOB_ACTIVITY.$JobStatus = 1 or JOB_ACTIVITY.$JobStatus = 2
and that code worked as expected. After the job failed, the next job did not start.

Any more thoughts?

Thanks in advance.
Jweir

--- If strength were all, tiger would not fear scorpion.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Ack... forgot to point out the fly in the ointment! :shock:

Those values are just the "1" and the "2" you used explicitly in your second example, they do not stand on their own. So your first attempt equates to saying "1 or 2" which is always true.

Combine the two to get everything all proper like:

Code: Select all

JOB_ACTIVITY.$JobStatus = DSJS.RUNWARN or JOB_ACTIVITY.$JobStatus = DSJS.RUNOK
-craig

"You can never have too many knives" -- Logan Nine Fingers
jweir
Participant
Posts: 134
Joined: Wed Aug 04, 2010 12:31 pm

Post by jweir »

Ah ok. So you are saying by putting the below just in the trigger, no matter what, it is always true?

Code: Select all

DSJS.RUNWARN or DSJS.RUNOK
I will test out your suggestion.

Thanks.
Jweir

--- If strength were all, tiger would not fear scorpion.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Yup! It needs to know what ran ok or with warnings.
-craig

"You can never have too many knives" -- Logan Nine Fingers
jweir
Participant
Posts: 134
Joined: Wed Aug 04, 2010 12:31 pm

Post by jweir »

Thanks chulett. Your suggestion worked.
Jweir

--- If strength were all, tiger would not fear scorpion.
Post Reply