I want SAS to send an email out, but only if a global macro variable &warning is equal to 1.
Is this possible? I'm trying the following, but it's not working. It still sends an email when warning=0.
filename outbox email
to=('me@myemail.com')
subject='Warning Report'
from='you@myemail.com'
attach='/report.html';
DATA _null_;
file outbox;
Put "Hello,"//
"Warning report attached."//
"Regards,"/
"Chris";
if &warning. =1
run;