Page 1 of 1

Execute Command Stage

Posted: Tue Oct 07, 2008 12:52 am
by gsym
Hello,

I have a script, test.sh
========
#! /bin/ksh
if [-s $1]
then echo 0
else echo 1
fi
========
When i execute it I'm passing parameter (a filename).
> test.sh filename.txt
Everything is fine, the script returns 0 if the file has any data and vice versa.

When I call the same script in DataStage in the execute command stage,
I'm always getting the output as 1(From log)

Any suggestions.

Thank You -gsym

Posted: Tue Oct 07, 2008 1:45 am
by ray.wurlod
File name or file pathname?

DataStage probably does not execute in the same directory as the one in which you execute the script.

Posted: Tue Oct 07, 2008 2:53 am
by gsym
Hi,

I tried,

filepath/test.sh filepath/filename.txt

Now I got the output from compand as 0, but reply is 1 now (and got warning) and job got aborted.

Thanks - gsym

Posted: Tue Oct 07, 2008 7:13 am
by ray.wurlod
That's how default handling of non-zero exit status works. To override it handle the "failure" condition explicitly with a trigger.

Posted: Tue Oct 07, 2008 10:37 am
by gsym
Got, It - Thank You