BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
sdixit
Obsidian | Level 7

Hi ,

 

How to Email Excel file with Multiple work sheets as attachment using SAS EMAIL ?

I have a xlsx file to attach in my email

 

Filename hmmail_1 email TO=&Email_to_Id. CC=&Email_cc_Id.

Subject="abcth.."

 

Attach="/xx/xx/xx/xx./xx..xlsx" ;

 

%Macro Send_Mthly_Email;

Data _null_;

file hmmail_1 lrecl=375;

put "Hi All," //;

put "The report is completed."/;

put "Attached report is available ." //;

put "Thanks," /;

put "&Thanks_Name.";

output;

run;

%Mend;

%Send_Mthly_Email;

 
1 ACCEPTED SOLUTION

Accepted Solutions
DarthPathos
Lapis Lazuli | Level 10

Hi -

 

I use this paper all the time for how to build a macro for emailing.  You should be able to incorporate the code from the paper into your code and have everything work.

 

Good luck!

Chris

 

Has my article or post helped? Please mark as Solution or Like the article!

View solution in original post

4 REPLIES 4
DarthPathos
Lapis Lazuli | Level 10

Hi -

 

I use this paper all the time for how to build a macro for emailing.  You should be able to incorporate the code from the paper into your code and have everything work.

 

Good luck!

Chris

 

Has my article or post helped? Please mark as Solution or Like the article!
sdixit
Obsidian | Level 7

Hi Chris,

 

Thanks for sharing the paper. Indeed it was helpful for me. \

 

RW9
Diamond | Level 26 RW9
Diamond | Level 26

Just two things.  Firstly your companies email system will have size limitations on the emails you send - the reason being is that email is not a report delivery system, its principally for messaging.  Secondly, depending on setup and data in the report, you could breach rules on sending data as email (at least outside the company network) is not secure.  I would advise you, if your data has anything confidential, to address where and how you deliver reports - there are far better methods to get reports out to people, the use of secure portals - sharepoint for instance - or other secure platforms.  

DarthPathos
Lapis Lazuli | Level 10

Ooh good point @RW9!  I'm totally embarassed I didn't think to mention that, considering I work in a hosptial where privacy is a huge deal 🙂  

 

There are papers about encrypting data sets with WinZip and other utilities using SAS, but Sharepoint or internal share drive would be preferred.

 

Chris

Has my article or post helped? Please mark as Solution or Like the article!

sas-innovate-2024.png

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.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 3348 views
  • 0 likes
  • 3 in conversation