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;
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
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
Hi Chris,
Thanks for sharing the paper. Indeed it was helpful for me. \
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.
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
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.
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.