Don't get warning message for execute command

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
times29
Premium Member
Premium Member
Posts: 202
Joined: Mon Sep 22, 2008 3:47 pm

Don't get warning message for execute command

Post 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
prasson_ibm
Premium Member
Premium Member
Posts: 536
Joined: Thu Oct 11, 2007 1:48 am
Location: Bangalore

Post 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.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Do you have automatic error handling enabled in the sequence? Do you have a Failure trigger on the Execute Command activity?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
sudha03_vpr
Participant
Posts: 34
Joined: Tue Feb 26, 2013 9:36 am
Location: Chicago

Post 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.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

In my opinion you should never create DataStage jobs that abort intentionally.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

... unless it's a Sequence job that is restartable.
-craig

"You can never have too many knives" -- Logan Nine Fingers
times29
Premium Member
Premium Member
Posts: 202
Joined: Mon Sep 22, 2008 3:47 pm

Post 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.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
prasannakumarkk
Participant
Posts: 117
Joined: Wed Feb 06, 2013 9:24 am
Location: Chennai,TN, India

Post 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.
Thanks,
Prasanna
times29
Premium Member
Premium Member
Posts: 202
Joined: Mon Sep 22, 2008 3:47 pm

Post 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
times29
Premium Member
Premium Member
Posts: 202
Joined: Mon Sep 22, 2008 3:47 pm

Post 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
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post 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.
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
Post Reply