making a job to run infinitely

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
pandeesh
Premium Member
Premium Member
Posts: 1399
Joined: Sun Oct 24, 2010 5:15 am
Location: CHENNAI, TAMIL NADU

making a job to run infinitely

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

Re: making a job to run infinitely

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

"You can never have too many knives" -- Logan Nine Fingers
jgreve
Premium Member
Premium Member
Posts: 107
Joined: Mon Sep 25, 2006 4:25 pm

Sounds like a job for sequencer...

Post 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".
pandeesh
Premium Member
Premium Member
Posts: 1399
Joined: Sun Oct 24, 2010 5:15 am
Location: CHENNAI, TAMIL NADU

Post by pandeesh »

Accomplished via sequecer startloop activity and end loop activiy stages..

thanks
pandeeswaran
pandeesh
Premium Member
Premium Member
Posts: 1399
Joined: Sun Oct 24, 2010 5:15 am
Location: CHENNAI, TAMIL NADU

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

Post by chulett »

As noted, you can't so not really "accomplished" after all. And no... you don't. Honestly.
-craig

"You can never have too many knives" -- Logan Nine Fingers
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

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

"You can never have too many knives" -- Logan Nine Fingers
greggknight
Premium Member
Premium Member
Posts: 120
Joined: Thu Oct 28, 2004 4:24 pm

Post 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
"Don't let the bull between you and the fence"

Thanks
Gregg J Knight

"Never Never Never Quit"
Winston Churchill
Post Reply