Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.
Moderators: chulett , rschirm , roy
gsym
Charter Member
Posts: 118 Joined: Thu Feb 02, 2006 3:05 pm
Post
by gsym » Tue Oct 07, 2008 12:52 am
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
ray.wurlod
Participant
Posts: 54607 Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:
Post
by ray.wurlod » Tue Oct 07, 2008 1:45 am
File name or file pathname?
DataStage probably does not execute in the same directory as the one in which you execute the script.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
gsym
Charter Member
Posts: 118 Joined: Thu Feb 02, 2006 3:05 pm
Post
by gsym » Tue Oct 07, 2008 2:53 am
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
ray.wurlod
Participant
Posts: 54607 Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:
Post
by ray.wurlod » Tue Oct 07, 2008 7:13 am
That's how default handling of non-zero exit status works. To override it handle the "failure" condition explicitly with a trigger.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
gsym
Charter Member
Posts: 118 Joined: Thu Feb 02, 2006 3:05 pm
Post
by gsym » Tue Oct 07, 2008 10:37 am
Got, It - Thank You