Elegant way to stop a job when there's a row in a tbl?

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
cbres00
Participant
Posts: 34
Joined: Tue Sep 21, 2004 9:20 am

Elegant way to stop a job when there's a row in a tbl?

Post by cbres00 »

I need to extract data from a MS Sql table, but I want to do it only if there's a 'load completed' semaphore row in the table. In addition, I want to retry the job once every 15 minutes for one hour. If after an hour the row doesn't exist, I exit with a successful completion code.

If I do a 'before sql' query to see if the row exists, there's no mechanism to gracefully exit the stage/job...or maybe there is and I don't know it (which is entirely possible!).

How would you all execute this?

Thanks,
cbres00
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

If it was me then I would create a job and select this into a hash file. I would write a routine to read this and return a different value if it found it.Call this routine in a sequence. Have links for each value returned. One to run the job another to sleep 15 minutes. You can do sleep in a routine.
Mamu Kim
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

What if your load continues for more than 1 hour? Do you want to stop the load or let it continue in the background? Also what message must the user obtain from the process?

What if there is a lock and you try to reload the records again into the table?
Post Reply