我正在寻找一个解决方案,它将监视(使用do循环)dictionary.tables以获取特定表的最新修改日期(modate),并且一旦修改日期(modate)等于今天的日期,我希望通过SAS中的电子邮件设施。
可以这样做吗?
非常感谢
答案 0 :(得分:1)
听起来好像你需要定义一个包含现有代码的简单小宏:
/* 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;