Hi-
I tried searching for an answer here for this without luck. I'm still new to DataStage so please bear with me.
I have a DataStage Sequence I'm trying to get to work. The first stage in the sequence is an Execute Command stage (named Execute_Command_0). This stage executes a shell script on the UNIX server, which will set a return code to eiher zero or one. The Execute Command stage has two triggers, the first has Expression Type "OK - Conditional", the other has "Custom - Conditional". The problem is with the "Custom - Conditional". I have the expression in the trigger for this as follows:
Execute_Command_0.$ReturnValue = '1'
When I execute the job it aborts with the error messages below. But since I'm explicitly testing for this return code I'm not sure why DataStage is treating this as an Unhandled Failure. I also tried changing the Expression Type for the trigger to ReturnCode - Conditional, and setting the Expression to 1, but that also didn't work. I also tried changing the Expression to '1' and "1" which also didn't work.
In Director I see the following Warnings:
WARNING
checkWeekTest..JobControl (@Execute_Command_0): Command /sbin/sh /home/dsadm/scripts/checkWeek.sh did not finish OK, reply = '1'
WARNING
checkWeekTest..JobControl (@Execute_Command_0): Controller problem: Unhandled failure (1) encountered executing command /sbin/sh /home/dsadm/scripts/checkWeek.sh
INFO
checkWeekTest..JobControl (@Coordinator): Summary of sequence run
14:27:14: Sequence started (checkpointing on)
14:27:14: Execute_Command_0 (COMMAND /sbin/sh /home/dsadm/scripts/checkWeek.sh) started
14:27:15: Execute_Command_0 finished, reply=1
14:27:15: Exception raised: @Execute_Command_0, Unhandled failure (1) encountered executing command /sbin/sh /home/dsadm/scripts/checkWeek.sh
14:27:15: Sequence failed (restartable)
FATAL
checkWeekTest..JobControl (fatal error from @Coordinator): Sequence job (restartable) will abort due to previous unrecoverable errors
Any help would be greatly appreciated!!
Unix Return Code
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 1735
- Joined: Thu Mar 01, 2007 5:44 am
- Location: Troy, MI
Re: Unix Return Code
msacks wrote:Hi-
I tried searching for an answer here for this without luck. I'm still new to DataStage so please bear with me.
I have a DataStage Sequence I'm trying to get to work. The first stage in the sequence is an Execute Command stage (named Execute_Command_0). This stage executes a shell script on the UNIX server, which will set a return code to eiher zero or one. The Execute Command stage has two triggers, the first has Expression Type "OK - Conditional", the other has "Custom - Conditional". The problem is with the "Custom - Conditional". I have the expression in the trigger for this as follows:
Execute_Command_0.$ReturnValue = '1'
When I execute the job it aborts with the error messages below. But since I'm explicitly testing for this return code I'm not sure why DataStage is treating this as an Unhandled Failure. I also tried changing the Expression Type for the trigger to ReturnCode - Conditional, and setting the Expression to 1, but that also didn't work. I also tried changing the Expression to '1' and "1" which also didn't work.
In Director I see the following Warnings:
WARNING
checkWeekTest..JobControl (@Execute_Command_0): Command /sbin/sh /home/dsadm/scripts/checkWeek.sh did not finish OK, reply = '1'
WARNING
checkWeekTest..JobControl (@Execute_Command_0): Controller problem: Unhandled failure (1) encountered executing command /sbin/sh /home/dsadm/scripts/checkWeek.sh
INFO
checkWeekTest..JobControl (@Coordinator): Summary of sequence run
14:27:14: Sequence started (checkpointing on)
14:27:14: Execute_Command_0 (COMMAND /sbin/sh /home/dsadm/scripts/checkWeek.sh) started
14:27:15: Execute_Command_0 finished, reply=1
14:27:15: Exception raised: @Execute_Command_0, Unhandled failure (1) encountered executing command /sbin/sh /home/dsadm/scripts/checkWeek.sh
14:27:15: Sequence failed (restartable)
FATAL
checkWeekTest..JobControl (fatal error from @Coordinator): Sequence job (restartable) will abort due to previous unrecoverable errors
Any help would be greatly appreciated!!
Here for any stage if returns anything else than 0 then it is a error for datastage.
Since your execute command stage is returning 1 means it failed to execute.
Can you run it with a true condition so that it returns 0
if it runs then try not to get the value you are getting from 'Return Value'
try getting it from 'command output' option.
then don't forget to parse it correctly.
Priyadarshi Kunal
Genius may have its limitations, but stupidity is not thus handicapped.
Genius may have its limitations, but stupidity is not thus handicapped.
Thanks for the response. I already know that if the shell script exits with return code zero the sequence will not abort. DataStage allows me to create a trigger and create my own custom Exception handling, so it should be able to handle a return code other than zero and let me programatically deal with it. Any one else out there have any thoughts on this?
-
- Participant
- Posts: 27
- Joined: Thu Mar 20, 2008 11:55 am
-
- Participant
- Posts: 27
- Joined: Thu Mar 20, 2008 11:55 am
-
- Participant
- Posts: 27
- Joined: Thu Mar 20, 2008 11:55 am
Did you givemsacks wrote:Hi, please re-read my original post, I've already tried this.
returnvalue(conditional)=1
or ='1'
or = "1" ?
I tried with returnvalue(conditional)=1...without quotes and it works fine.
did you check your script file..
in error I see /sbin/sh
your script should start with #!/bin/sh without spaces
Please do try to Run your script from command line.
and can you post your script ..
Thanks.
"Creativity is the ability to use your available resources to their fullest."
"Creativity is the ability to use your available resources to their fullest."
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Just as a test, try using a Failure trigger (this can be a separate trigger from your custom trigger, and can lead nowhere, for example into a sequencer) - it is the existence of explicit failure handling that overrides automatic error handling.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.