Aaron
Aaron

Reputation: 11

SAS: Send email once tables have been modified/refreshed

I am looking for a solution which will monitor (using do loop) dictionary.tables for the latest modified date (modate) of a particular table and once the modified date (modate) equals today's date i want to be notified via the email facility in SAS.

Can this be done???

Many thanks

Upvotes: 0

Views: 89

Answers (1)

user667489
user667489

Reputation: 9569

It sounds as though you need to define a simple little macro incorporating your existing code:

/* Define a macro that sleeps in a loop until your condition is met */
%macro wait_then_email;
  %local EMAIL_CONDITION SLEEP;
  %let EMAIL_CONDITION = 0;
  %do %while(&EMAIL_CONDITION = 0);
    /* Insert logic here that sets &EMAIL_CONDITION to 1 based on moddate */

    /* Wait for 1 minute if condition not met*/
    %if &EMAIL_CONDITION = 0 %then %let SLEEP = %sysfunc(sleep(60,1));
  %end;
  /*Insert email generation code here*/
%mend;

/* Run the macro! */
%wait_then_email;

Upvotes: 1

Related Questions