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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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
  • 651 views
  • 0 likes
  • 2 in conversation