Test -s: Handle Unix Command Error, CC=1, and CC=0

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
zaino22
Premium Member
Premium Member
Posts: 81
Joined: Thu Mar 22, 2007 7:10 pm

Test -s: Handle Unix Command Error, CC=1, and CC=0

Post by zaino22 »

Hi Forum:
I have "test -s" in Execute command stage, and has one requirement, and last 2 are optional:

Return Value="0" then send email file is populated.
Return Value="1" Do nothing.
Return Value= Any Unix command Error, Abort the Job.

I want to be able to handle Unix command error in case if there is an issue (not really care about Return value=1) and if i don't handle Return value=1 I cant think of any other way to handle Unix command error.
Am i doing it right? or Should i only take care of Return Value="0" and send email, and not worry about Unix Command error?
For now, I have Email step at=0, sequencer (with no output links) at =1 and Terminate sequence at otherwise (Unix command error). Is this acceptable practice ? please share your suggestions.
Thanks to all who reply.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Exit status 0 is handled by an OK trigger. Exit status 1 would need to be handled by a Custom trigger. The others can be handled by an Otherwise trigger into a Terminator.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
zaino22
Premium Member
Premium Member
Posts: 81
Joined: Thu Mar 22, 2007 7:10 pm

Post by zaino22 »

Thanks for your reply Ray...
So to handle OK, did i do it right by creating an output link that leads to a sequence and which in turn does nothing or is there any other way to handle OK knowing I really don't want to trigger anything just handle it.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

If you mean "leads to a Sequencer" you've got it.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
fmou
Participant
Posts: 124
Joined: Sat May 28, 2011 9:48 pm

Post by fmou »

zaino22 wrote:So to handle OK, did i do it right by creating an output link that leads to a sequence and which in turn does nothing or is there any other way to handle OK knowing I really don't want to trigger anything just handle it.
Did you mean Return Value="0" or 1? Because Exit status 0 is handled by an OK trigger, and you said,

Return Value="0" then send email file is populated.
Return Value="1" Do nothing.

thx
zaino22
Premium Member
Premium Member
Posts: 81
Joined: Thu Mar 22, 2007 7:10 pm

Post by zaino22 »

To "fmou": I am sorry I didn't mean OK I meant Return Value=1 (do nothing) and Ray replied Its okay to use sequencer to handle do nohing link.

Thanks Ray for your help and thanks for pointing out my incorrect reference to sequencer. :)
Post Reply