Page 1 of 1

making a job to run infinitely

Posted: Wed May 04, 2011 9:55 am
by pandeesh
Hi,

The below is not any project requirements.

Due to curiosity, i am asking this..

I am having a simple job(may b either parallel or server job)

i want to make this job to run infinitely..

first time i want to run this job using script or manually .

After that, regardless of the result of the run(it may return 1,2,or 3),

the job has to run again and this loop should be repeated.

Is it possible to achieve this in datastage without using any schedulers like crontab or TWS?

Thanks

Re: making a job to run infinitely

Posted: Wed May 04, 2011 11:07 am
by chulett
pandeesh wrote:i want to make this job to run infinitely..
No, you don't. At least not any kind of 'normal' job. Now, that would be perfectly acceptable for a job exposed as a service and is known as "Always On".

Sounds like a job for sequencer...

Posted: Wed May 04, 2011 12:16 pm
by jgreve
pandeesh wrote:Hi,
first time i want to run this job using script or manually .
After that, regardless of the result of the run(it may return 1,2,or 3),
the job has to run again and this loop should be repeated.

Is it possible to achieve this in datastage without using any schedulers like crontab or TWS?
Have you considered calling your job from a sequencer?
viewtopic.php?t=113069
Set up the sequencer to loop on your job.
Your script could launch the sequencer, or you manually launch the sequencer. *shrug* either way, your job will be continuously invoked.

You could also get fancy and add an abort check, e.g. stop looping if some file exists, like "/tmp/abort.dat".

Posted: Thu May 05, 2011 6:23 am
by pandeesh
Accomplished via sequecer startloop activity and end loop activiy stages..

thanks

Posted: Thu May 05, 2011 6:24 am
by pandeesh
How to mention infinite in the start loop activity stage in the place of loop definition?

becaus ei want to run the job infinitely?

thanks

Posted: Thu May 05, 2011 6:26 am
by chulett
As noted, you can't so not really "accomplished" after all. And no... you don't. Honestly.

Posted: Thu May 05, 2011 7:24 am
by chulett
Now, you can make it run daily and run for the vast majority of the day but it really should stop once a day to clear its logs (amongst other things) even if it's only for a minute or two. And I certainly hope you build a way out, some way to shut the loop down on demand. I always poll during each iteration for a semaphore or flag file, if found the loop and thus the job are exited gracefully.

Posted: Thu May 05, 2011 7:28 am
by greggknight
I really don't see why you would want to to that unless like chulett says if you wanted a service. Then I would create the datastage job to run as a service.

Otherwise if you really wanted to do it, write a shell script to either execute your job or sequence using dsjob

then
x= 1
y=2
while y > 2
Do
dsjob -...........

check job status
if it failed execute dsjob and reset job

sleep 10
##add any other logic you want here before you run again.
done

I would be carefull if something screws up you cold consume some resource