Page 1 of 1

run job once otherwise exit

Posted: Wed Jul 06, 2005 12:29 am
by htrisakti3
I need help to do the following:

1 job is to populate/refresh hash-files only 1x/day.

Can I have a logic that checks the recency of the hash-files, if they're > 24hrs old, open DB connection & re-create them.. otherwise just exit from the job without openning DB. this is due to slow DB performance for lookup.

cheers
HT

Posted: Wed Jul 06, 2005 12:56 am
by kduke
You need to check this before you run the job either in a routine or in batch job. You can open the file and use STATUS command to see how old it is or use a DOS or UNIX command like DIR or ls -l.

Posted: Wed Jul 06, 2005 1:52 am
by ray.wurlod
Your job that does it can emplace a flag, for example a record in a hashed file (SDKSequences would do). This record has a constant for its key, and the date as its non-key field. Look this up and proceed only if it's date is earlier than today's date.