Page 1 of 1

Don't get warning message for execute command

Posted: Tue Mar 12, 2013 1:08 pm
by times29
Hi,
I am calling below script from execute command and it fails but not seeing in warning in director who can i fix that.

csh /aa/app/scripts/Capital.csh


#!/bin/csh

ssh -i /aa/oracle/.ssh/rsa_cognos10_dsadmin test pfexec /ee/c10_cubes/script/Capital.sh

set vReturnStatus = $status

exit $vReturnStatus

i get

Reply=127
Output from command ====>

but i don't see warning in director who can i get warning in director if Reply is not 0

Thanks

Posted: Tue Mar 12, 2013 2:17 pm
by prasson_ibm
Hi,
I am not sure how you will get warning message,but in case you want to abort the seq. ,that you can set in seq.

Posted: Tue Mar 12, 2013 3:10 pm
by ray.wurlod
Do you have automatic error handling enabled in the sequence? Do you have a Failure trigger on the Execute Command activity?

Posted: Tue Mar 12, 2013 4:22 pm
by sudha03_vpr
You may need to add a link from the execute command to the notification activity followed by terminator stage to abort the process.

Trigger option of the execute command should be custom conditional and define your condition there in case of unexpected output.

Posted: Tue Mar 12, 2013 4:54 pm
by ray.wurlod
In my opinion you should never create DataStage jobs that abort intentionally.

Posted: Tue Mar 12, 2013 7:13 pm
by chulett
... unless it's a Sequence job that is restartable.

Posted: Tue Mar 12, 2013 7:21 pm
by times29
Well that will not fix my problem

where is scenario

execute command1 --->execute command 2----->execute command 3 these are in sequence 1 then sequence 2 is trigger by sequence 1 OK condition

What happen right now is even if execute command 2 fails i don't see any warning or abort message in sequence 1 as it is not generating one.

Posted: Tue Mar 12, 2013 7:26 pm
by chulett
You need to check the return status between the Execute Command stages and decide what to do if they "fail". What is your trigger expression? Or at least answer Ray's questions.

Posted: Tue Mar 12, 2013 11:19 pm
by prasannakumarkk
Can you please confrim what is happening in the script that you have posted?
ssh -i /aa/oracle/.ssh/rsa_cognos10_dsadmin test pfexec /ee/c10_cubes/script/Capital.sh

set vReturnStatus = $status

exit $vReturnStatus
1) $status - Will it have the return value or exit value of the previous executed command/script. In most of scripting we use $?

2) Return code 127 is for command/script not found. Debug the script please. If your script gives a proper exit DS will fail.

Posted: Wed Mar 13, 2013 6:23 am
by times29
i want somethimg like below in return trigger who can i rewrite it in trigger.

If vRtnCode <> 0 or ISNULL(vRtnCode) = 1 Then vErrCode = DSLogEvent (DSJ.ME, DSJ.LOGWARNING, "Script completed with a non-zero valued return code:" : vRtnCode) end

Posted: Wed Mar 13, 2013 6:42 am
by times29
I am doing custom trigger now still not getting warning and yes
automatic error handling is enabled in the sequence

if Build_Cube_Quarter.$ReturnValue <>0 then JOBSTATUS =2 else JOBSTATUS =1


Reply=127
Output from command ====>
/db01/c10_cubes/script/DSFINBUILD_Quarter.sh: line 2: -: command not found

Posted: Wed Mar 13, 2013 7:09 am
by chulett
You cannot set any sort of "job status" in the trigger. However, you can check $ReturnValue <>0 and branch to a Terminator to abort the Sequence if that's what you want.

Posted: Thu Mar 14, 2013 3:06 pm
by priyadarshikunal
In sequence there should be a option to "Log warning for the steps failed other than OK" or similar. If that option is checked, then if the return value is not 0 from the command, a warning will be logged for execute command stage.

However I support the method of handling the return values in trigger expression and have a control over the jobs fate.