I was told that to make use of SAS DI functionality and create a SAS DI job for below code for e-mail part note : Here .csv files that are created ,iam getting the data from work table that iam creating as part of this job. would you please help %macro sendmail;
data _null_;
call symputx('TEST',nobs);
set TEST_stats nobs=nobs;
run;
%if %eval(&TEST > 0) %then %do;
proc export
data=TEST_stats
outfile="%sysfunc(pathname(work))/TEST.csv"
dbms=csv
label
replace
;
quit;
proc export
data=TEST1
outfile="%sysfunc(pathname(work))/TEST_TEST1.csv"
dbms=csv
label
replace
;
quit;
filename email email
from="xxxx.com"
sender="xxxx.com"
to=("xxxx.com" "xxxx.com")
cc=("xxxx.com" "xxxx.com" "xxxx.com" "xxxx.com")
subject="Please refer attached TEST.csv and TEST_TEST1.csv for %sysfunc(putn(%eval(%sysfunc(today())-1),date9.))"
attach=("%sysfunc(pathname(work))/TEST.csv" "%sysfunc(pathname(work))/TEST_TEST1.csv")
importance='high'
;
data _null_;
file email;
put
"Hello" //
"Please refer attached TEST.csv and TEST_TEST1.csv for %sysfunc(putn(%eval(%sysfunc(today())-1),date9.))." //
;
put
"Test1" //
"Test2" //
;
run;
%end;
%else %do;
filename email1 email
from="xxxx.com"
sender="xxxx.com"
to=("xxxx.com" "xxxx.com")
cc=("xxxx.com" "xxxx.com" "xxxx.com" "xxxx.com")
subject="No data for TEST.csv and TEST_TEST1.csv"
importance='high'
;
... View more