Delay running code using a dataset modate/created date

Reply
New Contributor
Posts: 3

Delay running code using a dataset modate/created date

I would like to delay the code I am running using the date modified/created of a key dataset.  So, only run once xx dataset is updated for the day.

I have been trying to find if this is possible but cannot see anything obvious.

Does anyone have any tips/suggestions/solutions?

Super User
Posts: 5,434

Re: Delay running code using a dataset modate/created date

Posted in reply to Paul_Collier

Could you please exemplify? Are there rules on what jobs should run how often etc? What do you mean by delay?

Depending on the complexity of your system, it sounds like you could benefit from using scheduling software.

Data never sleeps
New Contributor
Posts: 3

Re: Delay running code using a dataset modate/created date

Thanks for your reply.

Specifically.  I run a piece of code on a dataset.  This occurs daily but the source dataset is updated at a variable point in the day.  It can be 9am or as late as 1pm.

The source data is updated as part of a batch process.  My code cannot be included in the batch process so I am looking to delay the running of it until the source data has had the daily updated.

Does this help to clarify the requirement?

Super User
Posts: 5,434

Re: Delay running code using a dataset modate/created date

Posted in reply to Paul_Collier

If you are not going all in for a scheduler, you could create a code snippet that checks the SAS table for update time (there is a SAS file function available for this), then checks a log table for completed executions. Then terminate the session if not the execution criteria is fulfilled (or do %include or similar call if executions criteria is fulfilled).

Then o course you need to add to the log after a successful execution is done.

Data never sleeps
New Contributor
Posts: 3

Re: Delay running code using a dataset modate/created date

Thanks for your reply.  That broadly makes sense to me - do you have any pointers as I am still a relative novice sas coder.

thanks very much

Ask a Question
Discussion stats
  • 4 replies
  • 269 views
  • 0 likes
  • 2 in conversation