Using Wait For File Logic

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

A search of DSXchange will uncover suitable routine code.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
RAJARP
Participant
Posts: 147
Joined: Thu Dec 06, 2007 6:46 am
Location: Chennai

Post by RAJARP »

hi suresh....
your requirement could be achieved without a WFF but by using a shell script and an execute command activity.

Code: Select all

wait_time=<period u need to wait for that ready file>
time=0
while [ $time != $wait_time ]
do
if [ -f /readyfilelocation/Ready_*.csv ]
then
flag=0
echo "ready file found"
echo $flag
exit 0
break
else
time=$(($time+1))
fi
done
Now call your script from execute command activity:
command:sh
parameter:unixscriptname
trigger: conditional trigger(return value=0),to proceed furthur....

anyway double check the script before running it
regards,
rajarp
suresh.narasimha
Premium Member
Premium Member
Posts: 81
Joined: Mon Nov 21, 2005 4:17 am
Location: Sydney, Australia
Contact:

Using Wait For File Logic

Post by suresh.narasimha »

Hi Raja and Ray

Thanks very much for your answers.

I'll try and implement the logic.
SURESH NARASIMHA
aartlett
Charter Member
Charter Member
Posts: 152
Joined: Fri Apr 23, 2004 6:44 pm
Location: Australia

Re: Using Wait For File Logic

Post by aartlett »

suresh.narasimha wrote:Hi Raja and Ray

Thanks very much for your answers.

I'll try and implement the logic.
Suresh,
I'd add a sleep command at the
"else
time=$(($time+1))
fi
"
and increment time by the sleep size, otherwise this is going to spin your processor out of control.
Andrew

Think outside the Datastage you work in.

There is no True Way, but there are true ways.
Post Reply