<?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 Include table and attachment in same email in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Include-table-and-attachment-in-same-email/m-p/628063#M185516</link>
    <description>&lt;P&gt;Hello, I have some code that successfully includes table values in an email using the "Proc Print" procedure. Now I would like to add an .xls attachment in the same email. When I include the "ATTACH" code I receive an error stating the code is out of order. My email still sends although without the attachment. Suspecting I need to add more ODS statements.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my code... Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;FILENAME mail EMAIL TO=("xxx.com" )
FROM = "xxx.com"
SUBJECT="xxx" CONTENT_TYPE="text/html";
ODS LISTING CLOSE;
ODS HTML BODY=mail;
FILENAME PRINT;
PUT "Good Morning, Attached is .... Please let me know if you have any questions"
ATTACH = ( "xxx..xls" content_type="application/excel");
PROC PRINT DATA=Exclusion_Summ NOOBS;
RUN;
PROC PRINT DATA=Report_Summ NOOBS;
RUN;
PROC PRINT DATA=Output_Summ NOOBS;
RUN;
ODS HTML CLOSE;
ODS LISTING;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 27 Feb 2020 22:23:35 GMT</pubDate>
    <dc:creator>Timg</dc:creator>
    <dc:date>2020-02-27T22:23:35Z</dc:date>
    <item>
      <title>Include table and attachment in same email</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Include-table-and-attachment-in-same-email/m-p/628063#M185516</link>
      <description>&lt;P&gt;Hello, I have some code that successfully includes table values in an email using the "Proc Print" procedure. Now I would like to add an .xls attachment in the same email. When I include the "ATTACH" code I receive an error stating the code is out of order. My email still sends although without the attachment. Suspecting I need to add more ODS statements.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my code... Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;FILENAME mail EMAIL TO=("xxx.com" )
FROM = "xxx.com"
SUBJECT="xxx" CONTENT_TYPE="text/html";
ODS LISTING CLOSE;
ODS HTML BODY=mail;
FILENAME PRINT;
PUT "Good Morning, Attached is .... Please let me know if you have any questions"
ATTACH = ( "xxx..xls" content_type="application/excel");
PROC PRINT DATA=Exclusion_Summ NOOBS;
RUN;
PROC PRINT DATA=Report_Summ NOOBS;
RUN;
PROC PRINT DATA=Output_Summ NOOBS;
RUN;
ODS HTML CLOSE;
ODS LISTING;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 27 Feb 2020 22:23:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Include-table-and-attachment-in-same-email/m-p/628063#M185516</guid>
      <dc:creator>Timg</dc:creator>
      <dc:date>2020-02-27T22:23:35Z</dc:date>
    </item>
    <item>
      <title>Re: Include table and attachment in same email</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Include-table-and-attachment-in-same-email/m-p/628068#M185519</link>
      <description>&lt;P&gt;1. The PUT statement must be inside a data step. Add:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  file MAIL;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;before the PUT statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. ATTACH is an option for the FILENAME statement.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2020 22:38:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Include-table-and-attachment-in-same-email/m-p/628068#M185519</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-02-27T22:38:48Z</dc:date>
    </item>
    <item>
      <title>Re: Include table and attachment in same email</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Include-table-and-attachment-in-same-email/m-p/628310#M185633</link>
      <description>&lt;P&gt;Thank you so much Chris! Works great, here is the code&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;FILENAME mail EMAIL TO=("xxx.com" )
FROM = "xxx.com"
SUBJECT="xxx" CONTENT_TYPE="text/html";&lt;BR /&gt;&lt;BR /&gt;ATTACH = ( "/xx/xx..xls" content_type="application/excel");
ODS LISTING CLOSE;
ODS HTML BODY=mail;
	
data _null_;
  file MAIL;
	PUT "Good Morning, Attached is .... Please let me know if you have any questions";
RUN;

PUT "Good Morning, Attached is .... Please let me know if you have any questions"
ATTACH = ( "xxx..xls" content_type="application/excel");
PROC PRINT DATA=Exclusion_Summ NOOBS;
RUN;
PROC PRINT DATA=Report_Summ NOOBS;
RUN;
PROC PRINT DATA=Output_Summ NOOBS;
RUN;
ODS HTML CLOSE;
ODS LISTING;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 28 Feb 2020 19:31:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Include-table-and-attachment-in-same-email/m-p/628310#M185633</guid>
      <dc:creator>Timg</dc:creator>
      <dc:date>2020-02-28T19:31:27Z</dc:date>
    </item>
  </channel>
</rss>

