Hi. I don't use a macro in SAS very often. There is one that I use to send e-mails. However, I don't want this macro to be used every time. I want to add a condition that if the WORK.TEST table is empty (no rows) then do not execute the macro, otherwise it will execute the macro.
Macro code is here:
%macro send_email(to, subject);
FILENAME Mailbox EMAIL;
data _NULL_;
file MailBox
to=(&to.)
from='noreply@***.com'
subject=&subject.;
put "This is email sent by macro.";
run;
%mend;
%let today_d = %sysfunc(date(), DDMMYY10.);
%let emails_to = "myemail@***.com";
%let subject = "Subject of mail and date: &today_d.";
%send_email(&emails_to., &subject.);
Can You help me with solution how to execute macro if work.test is not empty?
... View more