<?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: Excel Report ( Conditional formatted) as attachment in Email in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Excel-Report-Conditional-formatted-as-attachment-in-Email/m-p/94678#M19971</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Cynthia&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you so much for such detailed explanation. I am very thankful to you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 11 Dec 2012 17:52:08 GMT</pubDate>
    <dc:creator>bnarang</dc:creator>
    <dc:date>2012-12-11T17:52:08Z</dc:date>
    <item>
      <title>Excel Report ( Conditional formatted) as attachment in Email</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Excel-Report-Conditional-formatted-as-attachment-in-Email/m-p/94675#M19968</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it possible to produce an Excel report from SAS with conditional formatting and be attached in email using sas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 09 Dec 2012 07:17:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Excel-Report-Conditional-formatted-as-attachment-in-Email/m-p/94675#M19968</guid>
      <dc:creator>bnarang</dc:creator>
      <dc:date>2012-12-09T07:17:57Z</dc:date>
    </item>
    <item>
      <title>Re: Excel Report ( Conditional formatted) as attachment in Email</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Excel-Report-Conditional-formatted-as-attachment-in-Email/m-p/94676#M19969</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Undoubtedly one of the best resources for questions of this type: Chevell Parker from SAS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Read e.g.&amp;nbsp; &lt;A href="http://www2.sas.com/proceedings/sugi31/091-31.pdf" title="http://www2.sas.com/proceedings/sugi31/091-31.pdf"&gt;http://www2.sas.com/proceedings/sugi31/091-31.pdf&lt;/A&gt;&amp;nbsp; having a small section on emailing HTML documents directly from SAS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For a more refined search start at&amp;nbsp; &lt;A href="http://www.lexjansen.com/" title="http://www.lexjansen.com/"&gt;Lex Jansen's Homepage&lt;/A&gt; by entering some of the buzzwords your are looking for in its Search box.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Robert&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 09 Dec 2012 08:43:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Excel-Report-Conditional-formatted-as-attachment-in-Email/m-p/94676#M19969</guid>
      <dc:creator>Robert_Bardos</dc:creator>
      <dc:date>2012-12-09T08:43:28Z</dc:date>
    </item>
    <item>
      <title>Re: Excel Report ( Conditional formatted) as attachment in Email</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Excel-Report-Conditional-formatted-as-attachment-in-Email/m-p/94677#M19970</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And, there have been many previous forum postings on both trafficlighting and emailing. Here's a simple example, using PROC REPORT to get you started.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First, you need to create either the CSV, the HTML or the XML file to email. When you need highlighting and colors added to your output, you can't use CSV as your destination of choice. So that leaves creating either a Microsoft HTML file or a Microsoft XML file that Excel can open and render. The example below uses ODS MSOFFICE2K, which creates Microsoft-friendly HTML. I have named the file with a .XLS file extension so that it automatically opens in Excel when someone double clicks on the file. See the example of the output in the screenshot.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;proc format;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; value agef 11-12='yellow'&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 13-14='cyan'&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 15-16='cxdddddd';&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;ods msoffice2k file='c:\temp\hilite.xls' style=sasweb;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;proc report data=sashelp.class nowd;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;title 'Highlighting Conditionally';&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;column name age height weight sex;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;define name / order;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;define age / display&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; style(column)={background=agef.};&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;define height / display;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;define weight / display;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;define sex / display;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;compute sex;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp; if substr(name,1,1) = 'J' and&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sex = 'F' then do;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call define('name','style','style={background=pink}');&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call define(_col_,'style','style={background=pink}');&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp; end;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp; else if substr(name,1,1) = 'J' and&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sex = 'M' then do;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call define('name','style','style={background=lightblue}');&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call define(_col_,'style','style={background=lightblue}');&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp; end;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; endcomp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;ods msoffice2k close;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will find many examples of emailing in the forums. My recommendation would be 1) create the HTML file (named XLS) and then 2) draft your email and send the file created in #1 as an attachment to the mail. The body of the mail should warn the recepients that they will probably see an Excel message that will "warn" them the file extension is not in sync with the contents of the file (which is technically true -- an HTML file is not a true binary .XLS file). They will just need to click 'Yes' on the message to open the file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, to email, follow this model:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;**1) make file;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;ods msoffice2k body='c:\temp\class.xls' rs=none style=sasweb;&lt;/STRONG&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;STRONG style="font-family: Courier New;"&gt;... your code ...&lt;/STRONG&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;ods msoffice2k close;&lt;/STRONG&gt;&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;**2) Now send the file as an attachment;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;filename doemail email &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; to=(&lt;A href="mailto:'one.person@sas.com'"&gt;'one.person@sas.com'&lt;/A&gt; &lt;A href="mailto:'another.person@sas.com'"&gt;'another.person@sas.com'&lt;/A&gt;)&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;A href="mailto:from='ima.programmer@sas.com'"&gt;from='ima.programmer@sas.com'&lt;/A&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cc=(&lt;A href="mailto:'also.interested@sas.com'"&gt;'also.interested@sas.com'&lt;/A&gt;)&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; subject='Open this report in Excel'&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; attach='c:\temp\class.xls';&lt;/STRONG&gt;&lt;BR /&gt;&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;&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; &lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;data _null_;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; file doemail;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; put 'This is a test email with an HTML attachment.';&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; put 'However, I named the file as .XLS so you could see it';&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; put 'in Excel. If you get a popup window from Excel,';&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; put 'just click "Yes" to open the file';&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/11344iDEB981168E0D25B5/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Hilite_examp.png" title="Hilite_examp.png" /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 09 Dec 2012 16:25:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Excel-Report-Conditional-formatted-as-attachment-in-Email/m-p/94677#M19970</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2012-12-09T16:25:32Z</dc:date>
    </item>
    <item>
      <title>Re: Excel Report ( Conditional formatted) as attachment in Email</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Excel-Report-Conditional-formatted-as-attachment-in-Email/m-p/94678#M19971</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Cynthia&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you so much for such detailed explanation. I am very thankful to you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Dec 2012 17:52:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Excel-Report-Conditional-formatted-as-attachment-in-Email/m-p/94678#M19971</guid>
      <dc:creator>bnarang</dc:creator>
      <dc:date>2012-12-11T17:52:08Z</dc:date>
    </item>
  </channel>
</rss>

