I have this code that send out email with text in the email from a email address found in the data pulled (code 1)and i have another code that makes a excel file for each email/person and email that(code 2) what I want to do is match the email/names in both codes and attach the excel file from code 2 to code 1 email and get rid of the email in code 2 all together.
Run the excel export code before you send email "one", and use the attach= option there in the filename email.
how will the email (code 1) know to attach the excel file that matches the same name?
is there code that can tell the email to match the email address or names so that it only gets data and excel file for a specific person and sents that out.
To dynamically email different recipients with different attachments you will need to use PUT statement email directives. This link to the documentation explains directives:
@hk2013 wrote:
is there code that can tell the email to match the email address or names so that it only gets data and excel file for a specific person and sents that out.
First, set up a list of recipients in a dataset.
Then, wrap your code(s) in macro definitions where the recipient is accepted as a macro parameter.
Now you can use call execute() to call your macro(s) from the recipients dataset.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.