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 email@example.com , southern region data to firstname.lastname@example.org 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 = 'email@example.com' emailpw = 'xxxx' emailhost = 'smtp.gmail.com' emailport = 587 ; options emailhost= ( 'smtp.gmail.com' STARTTLS auth=LOGIN firstname.lastname@example.org' pw='xxxx' port=587 ) ; filename f_email email to = 'email@example.com' from = 'firstname.lastname@example.org' subject = 'Test' attach=("xxxx.xlsx" content_type="application/xlsx"); data _null_; file f_email; put 'Test'; run;