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