<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Email from SAS -Add report to body email and attach 2 files in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Email-from-SAS-Add-report-to-body-email-and-attach-2-files/m-p/934220#M367376</link>
    <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I wan tto send an email via SAS with following information:&lt;/P&gt;
&lt;P&gt;1- In body email add a summary table ( Data set-summary_report)&lt;/P&gt;
&lt;P&gt;2-In body email write a few sentences :&lt;/P&gt;
&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;Please find attached a summary report on sashelp.cars&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kind Regards,&lt;/P&gt;
&lt;P&gt;Joe&lt;/P&gt;
&lt;P&gt;3-Attach 2 files in one Excel file (It means that attach one excel file with 2 sheets)&lt;/P&gt;
&lt;P&gt;Attach1-summary_report&lt;/P&gt;
&lt;P&gt;Attach2-sashelp.cars raw data&lt;/P&gt;
&lt;P&gt;What is the code the perform this task?&lt;/P&gt;
&lt;P&gt;Should I export the 2 files first ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;

proc summary data=sashelp.cars;
class origin;
var msrp;
output out=summary_report mean=;
run;

proc export 
data=sashelp.cars
dbms=xlsx 
outfile="/usr/local/SAS/SASUsers/LabRet/UserDir/udclk79/cars.xlsx"
replace;
sheet='Raw_Data_Cars';
run;

proc export 
data=summary_report
dbms=xlsx 
outfile="/usr/local/SAS/SASUsers/LabRet/UserDir/udclk79/cars_summary_report.xlsx"
replace;
sheet='Raw_Data_Cars';
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 01 Jul 2024 07:06:56 GMT</pubDate>
    <dc:creator>Ronein</dc:creator>
    <dc:date>2024-07-01T07:06:56Z</dc:date>
    <item>
      <title>Email from SAS -Add report to body email and attach 2 files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Email-from-SAS-Add-report-to-body-email-and-attach-2-files/m-p/934220#M367376</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I wan tto send an email via SAS with following information:&lt;/P&gt;
&lt;P&gt;1- In body email add a summary table ( Data set-summary_report)&lt;/P&gt;
&lt;P&gt;2-In body email write a few sentences :&lt;/P&gt;
&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;Please find attached a summary report on sashelp.cars&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kind Regards,&lt;/P&gt;
&lt;P&gt;Joe&lt;/P&gt;
&lt;P&gt;3-Attach 2 files in one Excel file (It means that attach one excel file with 2 sheets)&lt;/P&gt;
&lt;P&gt;Attach1-summary_report&lt;/P&gt;
&lt;P&gt;Attach2-sashelp.cars raw data&lt;/P&gt;
&lt;P&gt;What is the code the perform this task?&lt;/P&gt;
&lt;P&gt;Should I export the 2 files first ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;

proc summary data=sashelp.cars;
class origin;
var msrp;
output out=summary_report mean=;
run;

proc export 
data=sashelp.cars
dbms=xlsx 
outfile="/usr/local/SAS/SASUsers/LabRet/UserDir/udclk79/cars.xlsx"
replace;
sheet='Raw_Data_Cars';
run;

proc export 
data=summary_report
dbms=xlsx 
outfile="/usr/local/SAS/SASUsers/LabRet/UserDir/udclk79/cars_summary_report.xlsx"
replace;
sheet='Raw_Data_Cars';
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jul 2024 07:06:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Email-from-SAS-Add-report-to-body-email-and-attach-2-files/m-p/934220#M367376</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2024-07-01T07:06:56Z</dc:date>
    </item>
    <item>
      <title>Re: Email from SAS -Add report to body email and attach 2 files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Email-from-SAS-Add-report-to-body-email-and-attach-2-files/m-p/934224#M367379</link>
      <description>&lt;UL&gt;
&lt;LI&gt;Create the Excel files&lt;/LI&gt;
&lt;LI&gt;Define a FILENAME EMAIL with the ATTACH= option for the files&lt;/LI&gt;
&lt;LI&gt;Open a ODS HTML destination to the email file&lt;/LI&gt;
&lt;LI&gt;Run the summary report, and PROC ODSTEXT for the text&lt;/LI&gt;
&lt;LI&gt;Close the ODS destination (the mail will be sent at that point)&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Mon, 01 Jul 2024 07:58:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Email-from-SAS-Add-report-to-body-email-and-attach-2-files/m-p/934224#M367379</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2024-07-01T07:58:57Z</dc:date>
    </item>
    <item>
      <title>Re: Email from SAS -Add report to body email and attach 2 files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Email-from-SAS-Add-report-to-body-email-and-attach-2-files/m-p/934505#M367479</link>
      <description>&lt;P&gt;Can you please show the code?&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2024 04:54:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Email-from-SAS-Add-report-to-body-email-and-attach-2-files/m-p/934505#M367479</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2024-07-03T04:54:51Z</dc:date>
    </item>
    <item>
      <title>Re: Email from SAS -Add report to body email and attach 2 files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Email-from-SAS-Add-report-to-body-email-and-attach-2-files/m-p/934520#M367486</link>
      <description>&lt;P&gt;As I can see you already solved this&amp;nbsp;&lt;A href="https://communities.sas.com/t5/SAS-Programming/send-email-via-sas-body-email-align-texts-to-right/m-p/934517/highlight/true#M367485" target="_blank" rel="noopener"&gt;here&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2024 07:30:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Email-from-SAS-Add-report-to-body-email-and-attach-2-files/m-p/934520#M367486</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2024-07-03T07:30:51Z</dc:date>
    </item>
  </channel>
</rss>

