BookmarkSubscribeRSS Feed
Paul_Collier
Calcite | Level 5

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?

4 REPLIES 4
LinusH
Tourmaline | Level 20

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
Paul_Collier
Calcite | Level 5

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?

LinusH
Tourmaline | Level 20

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
Paul_Collier
Calcite | Level 5

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

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 826 views
  • 0 likes
  • 2 in conversation