BookmarkSubscribeRSS Feed
hk2013
Fluorite | Level 6

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.

 
5 REPLIES 5
hk2013
Fluorite | Level 6

how will the email (code 1) know to attach the excel file that matches the same name? 

hk2013
Fluorite | Level 6

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. 

SASKiwi
PROC Star

To dynamically email different recipients with different attachments you will need to use PUT statement email directives. This link to the documentation explains directives:

http://support.sas.com/documentation/cdl/en/lestmtsref/63323/HTML/default/viewer.htm#n0ig2krarrz6vtn...

Kurt_Bremser
Super User

@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.

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 2020 views
  • 0 likes
  • 3 in conversation