I am required to send filtered excel attachment to different email ids from sas. For eg I have a column named region in the excel having 4 values - north,south,east, west and i have to send the northern region data to id xyz@jkl.com , southern region data to abc@jkl.com and so on. How should I go about filtering the excel via sas programming? Kindly help. Also, please suggest how to insert multiple recipients for which the filtering condition would be different.I'm attaching the code written on SAS Enterprise Guide 7.1 for single recipient which sends the unfiltered excel.
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=("xxxx.xlsx" content_type="application/xlsx");
data _null_;
file f_email;
put 'Test';
run;
Regards,
sklal