<?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 Report with attachements and summary details in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Report-with-attachements-and-summary-details/m-p/319440#M17525</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How to send the email with both attachments and the summary details.&amp;nbsp; Below is the output I need to send it in email to the customers along with the actual sales figure in the attachments. I am able to send the attachment successfully but I am struggling to the add the summary details in the mail.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please advise.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;Code I used &lt;/U&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* create summary report */
 
option nocenter;
ods tagsets.excelxp
path= '/Reports/Output'
      file="Salesreport_&amp;amp;rptdate..xls" style= sansprinter
            options(   
                  sheet_interval='none'
                  Orientation = 'landscape'
                  Autofit_Height = 'yes'
                  Embedded_Titles = 'yes'
                  fittopage = 'yes'          );
 
      ods tagsets.excelxp options(
                  Sheet_Name="Sales"
                  sheet_interval='none'
                  Absolute_Column_Width = '8'
                  );
            proc print data=_sales noobs; run;
ods tagsets.excelxp close;
 
 
/* send report thru email*/
 
filename myemail email
                  from=("salessupport@xyz.com")
                to=("salesmanager@xyz.com" )               
                  Subject = ("Salesreport_Monthly")              
                  attach=("/reports/Output/Salesreport_&amp;amp;rptdate..xls")
;
data _null_;
file myemail;
put "Hi All,";
put ' ';
put "Please refer the attached sales report for &amp;amp;rptdate..";
put ' ';
put "Summary of the report";
&amp;lt;&amp;lt; Need summary details here &amp;gt;&amp;gt;&amp;gt;
put "Regards,";
put ' ';
put "Sales support team";
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;
&lt;LI-SPOILER&gt;
&lt;P&gt;&lt;U&gt;Output required&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please refer the attached sales report for DEC16.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Summary of the report&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Region_name&amp;nbsp;&amp;nbsp; Sales_figure&lt;/P&gt;
&lt;P&gt;Texas&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $10000&lt;/P&gt;
&lt;P&gt;California &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $20500&lt;/P&gt;
&lt;P&gt;New York&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $23000&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;
&lt;P&gt;Sales support team&lt;/P&gt;
&lt;/LI-SPOILER&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 16 Dec 2016 03:55:35 GMT</pubDate>
    <dc:creator>angorwat</dc:creator>
    <dc:date>2016-12-16T03:55:35Z</dc:date>
    <item>
      <title>Report with attachements and summary details</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Report-with-attachements-and-summary-details/m-p/319440#M17525</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How to send the email with both attachments and the summary details.&amp;nbsp; Below is the output I need to send it in email to the customers along with the actual sales figure in the attachments. I am able to send the attachment successfully but I am struggling to the add the summary details in the mail.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please advise.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;Code I used &lt;/U&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* create summary report */
 
option nocenter;
ods tagsets.excelxp
path= '/Reports/Output'
      file="Salesreport_&amp;amp;rptdate..xls" style= sansprinter
            options(   
                  sheet_interval='none'
                  Orientation = 'landscape'
                  Autofit_Height = 'yes'
                  Embedded_Titles = 'yes'
                  fittopage = 'yes'          );
 
      ods tagsets.excelxp options(
                  Sheet_Name="Sales"
                  sheet_interval='none'
                  Absolute_Column_Width = '8'
                  );
            proc print data=_sales noobs; run;
ods tagsets.excelxp close;
 
 
/* send report thru email*/
 
filename myemail email
                  from=("salessupport@xyz.com")
                to=("salesmanager@xyz.com" )               
                  Subject = ("Salesreport_Monthly")              
                  attach=("/reports/Output/Salesreport_&amp;amp;rptdate..xls")
;
data _null_;
file myemail;
put "Hi All,";
put ' ';
put "Please refer the attached sales report for &amp;amp;rptdate..";
put ' ';
put "Summary of the report";
&amp;lt;&amp;lt; Need summary details here &amp;gt;&amp;gt;&amp;gt;
put "Regards,";
put ' ';
put "Sales support team";
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;
&lt;LI-SPOILER&gt;
&lt;P&gt;&lt;U&gt;Output required&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please refer the attached sales report for DEC16.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Summary of the report&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Region_name&amp;nbsp;&amp;nbsp; Sales_figure&lt;/P&gt;
&lt;P&gt;Texas&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $10000&lt;/P&gt;
&lt;P&gt;California &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $20500&lt;/P&gt;
&lt;P&gt;New York&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $23000&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;
&lt;P&gt;Sales support team&lt;/P&gt;
&lt;/LI-SPOILER&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Dec 2016 03:55:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Report-with-attachements-and-summary-details/m-p/319440#M17525</guid>
      <dc:creator>angorwat</dc:creator>
      <dc:date>2016-12-16T03:55:35Z</dc:date>
    </item>
    <item>
      <title>Re: Report with attachements and summary details</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Report-with-attachements-and-summary-details/m-p/319456#M17526</link>
      <description>&lt;P&gt;Store this:&lt;/P&gt;
&lt;PRE&gt;Texas                    $10000
California             $20500
New York            $23000&lt;/PRE&gt;
&lt;P&gt;in a dataset&lt;/P&gt;
&lt;P&gt;In your email code, do&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
set summary end=done; /* your summary dataset */
file myemail;
if _n_ = 1
then do;
  put "Hi All,";
  put ' ';
  put "Please refer the attached sales report for &amp;amp;rptdate..";
  put ' ';
  put "Summary of the report";
  put 'Region       Sales';
end;
put
  region_name
  sales_figure
;
if done
then do;
  put " "; /* add an empty line */
  put "Regards,";
  put ' ';
  put "Sales support team";
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You will need to adapt the positions in the header line to the lengths of your variables, and probably have to add formats in the put of the variables.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Dec 2016 07:08:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Report-with-attachements-and-summary-details/m-p/319456#M17526</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-12-16T07:08:11Z</dc:date>
    </item>
    <item>
      <title>Re: Report with attachements and summary details</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Report-with-attachements-and-summary-details/m-p/319457#M17527</link>
      <description>&lt;P&gt;And when using tagsets.excelxp, you should use a .xml filename extension, as Excel usually complains when the extension does not match the content type of a file.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Dec 2016 07:09:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Report-with-attachements-and-summary-details/m-p/319457#M17527</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-12-16T07:09:56Z</dc:date>
    </item>
  </channel>
</rss>

