<?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 Re: Add table to email body in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Add-table-to-email-body/m-p/934528#M367491</link>
    <description>&lt;P&gt;Here I write the text in body email in following way:&amp;nbsp; &amp;nbsp;put " text"&lt;/P&gt;
&lt;P&gt;In the other way I write the text in body email in following way:&amp;nbsp;ods html text = " ";&lt;/P&gt;
&lt;P&gt;The way put ="" provide much nicer result.&lt;/P&gt;
&lt;P&gt;I didnt succeed add summary table to body email when using put ""&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>Wed, 03 Jul 2024 09:51:22 GMT</pubDate>
    <dc:creator>Ronein</dc:creator>
    <dc:date>2024-07-03T09:51:22Z</dc:date>
    <item>
      <title>Add table to email body</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Add-table-to-email-body/m-p/934512#M367484</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;The following code send an email via sas with attached XLSX file and some sentences in email body.&lt;/P&gt;
&lt;P&gt;I want to add also to the body of email a summary report&lt;/P&gt;
&lt;P&gt;with following code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc report data=Last_7Days_c nowd;
compute 'סטטיסטי'n;
if substr(STAT,1,4)='AMNT then
call define(_row_, "style", "style=[backgroundcolor=lightyellow]");
endcomp;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Here is the code that run 100% but I need to add the summary report to body of email.&lt;/P&gt;
&lt;P&gt;What is the way to do it?&lt;/P&gt;
&lt;P&gt;Can you show the code please?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
filename outbox EMAIL;
data _null_;
FILE outbox
to=("Joe.Dave@gmail.com") 
FROM='SAS  &amp;lt;Ben.Stein@gmail.com&amp;gt;'
subject="Summary Sales"
encoding='utf-8' 
attach=("/path/My_File.xlsx"
content_type="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
file outbox;
ODS LISTING CLOSE;
ODS HTML BODY=mail;
put "Hello ";
put "Please see attached a file with summary report";
put "population-Customers age 20-40";
put " ";
put "Regards,";
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 03 Jul 2024 05:43:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Add-table-to-email-body/m-p/934512#M367484</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2024-07-03T05:43:38Z</dc:date>
    </item>
    <item>
      <title>Re: Add table to email body</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Add-table-to-email-body/m-p/934521#M367487</link>
      <description>&lt;P&gt;What's wrong with your own solution&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:32:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Add-table-to-email-body/m-p/934521#M367487</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2024-07-03T07:32:43Z</dc:date>
    </item>
    <item>
      <title>Re: Add table to email body</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Add-table-to-email-body/m-p/934528#M367491</link>
      <description>&lt;P&gt;Here I write the text in body email in following way:&amp;nbsp; &amp;nbsp;put " text"&lt;/P&gt;
&lt;P&gt;In the other way I write the text in body email in following way:&amp;nbsp;ods html text = " ";&lt;/P&gt;
&lt;P&gt;The way put ="" provide much nicer result.&lt;/P&gt;
&lt;P&gt;I didnt succeed add summary table to body email when using put ""&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>Wed, 03 Jul 2024 09:51:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Add-table-to-email-body/m-p/934528#M367491</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2024-07-03T09:51:22Z</dc:date>
    </item>
    <item>
      <title>Re: Add table to email body</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Add-table-to-email-body/m-p/934531#M367493</link>
      <description>&lt;P&gt;You have much more options regarding the format of the text when you use ODS TEXT instead of PUT in a DATA step. See the example for the use of PROC TEMPLATE:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options obs=10;
proc template;
   define style Styles.MyStyle;
   parent=styles.htmlblue;
   style usertext from usertext /
      foreground=red;
   end;
run;
ods html file="text.html" style=Styles.MyStyle ;
ods pdf file="text.pdf" startpage=never notoc style=Styles.MyStyle ;
ods rtf file="text_trad.rtf" style=Styles.MyStyle ;
title "January Orders ";
footnote " For All Employees";
ods text="My Text 1";
ods text="My Text 2"; 
proc print data=exprev;
run;
ods text="My Text 3"; 
ods pdf close;
ods rtf close;
ods html close;
title;
footnote;
proc template;
   delete Styles.MyStyle ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;taken from&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/odsug/p14gx25pepks6dn1q9m7vkq3gfoi.htm" target="_blank" rel="noopener"&gt;ODS TEXT= Statement&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Run your procedure creating the summary report while the ODS destination to the mail is open.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2024 10:59:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Add-table-to-email-body/m-p/934531#M367493</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2024-07-03T10:59:47Z</dc:date>
    </item>
  </channel>
</rss>

