I have prepared a dataset in sas and exported in the .xlsx format to a location on my computer. I'm able to send mail with the attachment which i have exported. I wanted to know if there's a possibility to apply a 'where' condition to a column(Region in this case,having 4 values -W,E,S,N) in the excel via sas programming and attach the filtered (specific records , like data for W,S only etc) excel file to an appropriate email address? Kindly help.I'm attaching the code written on SAS Enterprise Guide 7.1 for single recipient which sends the unfiltered excel and the image of the sample data.
options emailsys = smtp
emailid = 'xxxx@gmail.com'
emailpw = 'xxxx'
emailhost = 'smtp.gmail.com'
emailport = 587 ;
options emailhost=(
'smtp.gmail.com'
STARTTLS auth=LOGIN
id='xxxx@gmail.com'
pw='xxxx' port=587
);
filename f_email email
to = 'xxxx@jkl.com'
from = 'xxxx@gmail.com'
subject = 'Test'
attach=("D:\abc\xxxx.xlsx" content_type="application/xlsx");
data _null_;
file f_email;
put 'Test';
run;
Regards, sklal
You can't filter the excel file before sending it, You'll have to create one excel file for each region and attach it separately.
Steps: