Sending the Stop message to DataStage from Unix..
Moderators: chulett, rschirm, roy
Sending the Stop message to DataStage from Unix..
Hi
I am executing a shell script from Routine Activity sequence. When the shell scripts fails I am exiting with a non-zero value(say '88') which creates a warning message on the DataStage job log. I would like to get the FATAL error instead of Warning Message in the logs ? How can I do that ?
Thanks
I am executing a shell script from Routine Activity sequence. When the shell scripts fails I am exiting with a non-zero value(say '88') which creates a warning message on the DataStage job log. I would like to get the FATAL error instead of Warning Message in the logs ? How can I do that ?
Thanks
Craig,
Thanks for the quick reply. I have done it like this. Just want to make sure is thats what you meant...
Routine1 ---> Routine2
In Routine1's trigger I am using custom(conditional) and expression as DSJS.RUNWARN.
In Routine2 I am calling UtilityAborttoLog and Arg1 as DSJS.RUNWARN.
It works...But looks like I am stating the samething twice...Is this the correct approach ?
Thanks
Thanks for the quick reply. I have done it like this. Just want to make sure is thats what you meant...
Routine1 ---> Routine2
In Routine1's trigger I am using custom(conditional) and expression as DSJS.RUNWARN.
In Routine2 I am calling UtilityAborttoLog and Arg1 as DSJS.RUNWARN.
It works...But looks like I am stating the samething twice...Is this the correct approach ?
Thanks
A Custom trigger expects an Expression there, something that evaluates to true or false. You know, like "X = 1" or some such.
Having a singleton value - like DSJS.RUNWARN, which is a "2" by the way - means your expression is just "2". And since a zero is false and a non-zero value is true, that "expression" always evaluates to true. Hence your problem.
For a Routine Activity, all you can check is the $ReturnValue. It doesn't "run ok" or "run warn" like a job, it simply returns a value. Left to its own devices, it interprets a zero return value as 'Ran Ok' and any other value as 'Ran NOT Ok'. So, depending on what values your routine returns, you may need multiple triggers to catch all of the different results. You should be able to get that working if all you want to check is the status your script returns. You have coded it to return the value you were checking for as the exit code, yes, and are not simply echoing them to the screen or some such?
Now, if you ran that shell script via the Execute Command stage, then you've got another option on what you can check - $CommandOutput, whatever the command sends to standard out would be captured there.
This gets even more complicated if you've got the 'Automatically handle activities that fail' option turned on in the Sequence job.
Having a singleton value - like DSJS.RUNWARN, which is a "2" by the way - means your expression is just "2". And since a zero is false and a non-zero value is true, that "expression" always evaluates to true. Hence your problem.
For a Routine Activity, all you can check is the $ReturnValue. It doesn't "run ok" or "run warn" like a job, it simply returns a value. Left to its own devices, it interprets a zero return value as 'Ran Ok' and any other value as 'Ran NOT Ok'. So, depending on what values your routine returns, you may need multiple triggers to catch all of the different results. You should be able to get that working if all you want to check is the status your script returns. You have coded it to return the value you were checking for as the exit code, yes, and are not simply echoing them to the screen or some such?
Now, if you ran that shell script via the Execute Command stage, then you've got another option on what you can check - $CommandOutput, whatever the command sends to standard out would be captured there.
This gets even more complicated if you've got the 'Automatically handle activities that fail' option turned on in the Sequence job.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Completely overlooked that. I guess I was more concerned with your question of using it twice rather than what you are using. Sorry kaps.chulett wrote:I was wondering when you were going to figure that out.
What trigger are you using? Still this?
kaps wrote:In Routine1's trigger I am using custom(conditional) and expression as DSJS.RUNWARN.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.