<?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 Send results of PROC SQL in an e-mail automatically in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Send-results-of-PROC-SQL-in-an-e-mail-automatically/m-p/9849#M804</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oh, you want to send as attachment....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;filename tmp temp;&lt;/P&gt;&lt;P&gt;%let afile=%sysfunc(pathname(tmp));&lt;/P&gt;&lt;P&gt;filename eml email&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:to='mkastin@i-behavior.com"&gt;to='mkastin@i-behavior.com&lt;/A&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; subject='attach something'&lt;/P&gt;&lt;P&gt; attach=("&amp;amp;afile" ct='text/html' name='procsql_results' ext='html');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ods html body=tmp;&lt;/P&gt;&lt;P&gt; proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp; select * from sashelp.class;&lt;/P&gt;&lt;P&gt; quit;&lt;/P&gt;&lt;P&gt;ods html close;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt; file eml;&lt;/P&gt;&lt;P&gt;&amp;nbsp; put "It's done";&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 08 Dec 2011 16:47:44 GMT</pubDate>
    <dc:creator>FriedEgg</dc:creator>
    <dc:date>2011-12-08T16:47:44Z</dc:date>
    <item>
      <title>Send results of PROC SQL in an e-mail automatically</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Send-results-of-PROC-SQL-in-an-e-mail-automatically/m-p/9840#M795</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey guys...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On googling, I found the following template to send the output in an email automatically,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let subject = %str(Email configuration test);&lt;/P&gt;&lt;P&gt;%let fromEmail = '&amp;lt;Email Address&amp;gt;';&lt;/P&gt;&lt;P&gt;%let toEmail = '&amp;lt;Email Address&amp;gt;';&lt;/P&gt;&lt;P&gt;%let path = C:\documents and settings\&amp;amp;sysuserid.\my documents\test.htm;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FILENAME OUTPUT EMAIL&lt;/P&gt;&lt;P&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; SUBJECT = "&amp;amp;subject."&lt;/P&gt;&lt;P&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; FROM = &amp;amp;fromEmail.&lt;/P&gt;&lt;P&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; TO = &amp;amp;toEmail.&lt;/P&gt;&lt;P&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; CT ='text/html';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _NULL_;&lt;/P&gt;&lt;P&gt; file output;&lt;/P&gt;&lt;P&gt; put "Working";&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a couple of SQL queries (Select queries) which I have written in PROC SQL in a SAS program, I want the output in HTML format to be sent in an email automatically. &lt;STRONG&gt;How would I change the above template or any other simpler method??&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Dec 2011 21:22:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Send-results-of-PROC-SQL-in-an-e-mail-automatically/m-p/9840#M795</guid>
      <dc:creator>DrZenith</dc:creator>
      <dc:date>2011-12-06T21:22:22Z</dc:date>
    </item>
    <item>
      <title>Send results of PROC SQL in an e-mail automatically</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Send-results-of-PROC-SQL-in-an-e-mail-automatically/m-p/9841#M796</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; have a look at ATTACH E-mail option of the FILENAME statement in the doc at &lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a002058232.htm"&gt;http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a002058232.htm&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Dec 2011 21:56:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Send-results-of-PROC-SQL-in-an-e-mail-automatically/m-p/9841#M796</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2011-12-06T21:56:33Z</dc:date>
    </item>
    <item>
      <title>Send results of PROC SQL in an e-mail automatically</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Send-results-of-PROC-SQL-in-an-e-mail-automatically/m-p/9842#M797</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN&gt;filename eml email &lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:to='some@work.com"&gt;to='some@work.com&lt;/A&gt;&lt;SPAN&gt;';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;proc printto print=eml;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt; select * from sashelp.class;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;proc printto;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Dec 2011 01:34:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Send-results-of-PROC-SQL-in-an-e-mail-automatically/m-p/9842#M797</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2011-12-07T01:34:19Z</dc:date>
    </item>
    <item>
      <title>Send results of PROC SQL in an e-mail automatically</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Send-results-of-PROC-SQL-in-an-e-mail-automatically/m-p/9843#M798</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Missed that you wanted it in html format...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;filename eml email &lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:to='someone@work.com"&gt;to='someone@work.com&lt;/A&gt;&lt;SPAN&gt;' ct='text/html';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;ods listing close;&lt;/P&gt;&lt;P&gt;ods html body=eml;&lt;/P&gt;&lt;P&gt;ods select sql_results;&lt;/P&gt;&lt;P&gt;ods noproctitle;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt; select * from sashelp.class;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Dec 2011 01:38:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Send-results-of-PROC-SQL-in-an-e-mail-automatically/m-p/9843#M798</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2011-12-07T01:38:46Z</dc:date>
    </item>
    <item>
      <title>Send results of PROC SQL in an e-mail automatically</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Send-results-of-PROC-SQL-in-an-e-mail-automatically/m-p/9844#M799</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; I tried this but it looks like it delivered html code rather than output.&amp;nbsp; What do you think?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;html&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;head&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;meta name="Generator" content="SAS Software Version 9.3, see &lt;A href="http://www.sas.com"&gt;www.sas.com&lt;/A&gt;"&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;meta http-equiv="Content-type" content="text/html; charset=windows-1252"&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;title&amp;gt;SAS Output&amp;lt;/title&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;style type="text/css"&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;!--&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Dec 2011 14:06:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Send-results-of-PROC-SQL-in-an-e-mail-automatically/m-p/9844#M799</guid>
      <dc:creator>GreggB</dc:creator>
      <dc:date>2011-12-07T14:06:45Z</dc:date>
    </item>
    <item>
      <title>Re: Send results of PROC SQL in an e-mail automatically</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Send-results-of-PROC-SQL-in-an-e-mail-automatically/m-p/9845#M800</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is something that i tried and got a proper result&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ods _all_ close;&lt;/P&gt;&lt;P&gt;filename message email&lt;/P&gt;&lt;P&gt;&lt;A href="mailto:to=myid@mymail.com"&gt;to="&lt;/A&gt;&lt;A href="mailto:myid@mymail.com"&gt;myid@mymail.com&lt;/A&gt;"&lt;/P&gt;&lt;P&gt;from = "&lt;A _jive_internal="true" href="https://communities.sas.com/mailto:myid@m﻿"&gt;myid@m&lt;/A&gt;ymail.com"&lt;/P&gt;&lt;P&gt;subject = "test"&lt;/P&gt;&lt;P&gt;ct="text/html";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ods html body = message style = minimal rs=none;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;select * from sashelp.class;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;ods html close;&lt;/P&gt;&lt;P&gt;ods listing;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Dec 2011 15:03:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Send-results-of-PROC-SQL-in-an-e-mail-automatically/m-p/9845#M800</guid>
      <dc:creator>NN</dc:creator>
      <dc:date>2011-12-07T15:03:16Z</dc:date>
    </item>
    <item>
      <title>Send results of PROC SQL in an e-mail automatically</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Send-results-of-PROC-SQL-in-an-e-mail-automatically/m-p/9846#M801</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;GreggB,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is normally the result of not setting the content type on the filename statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;filename eml email &lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:to='someone@work.com" style="background-color: #ffffff; outline-style: none; padding-top: 1px; padding-bottom: 1px; padding-left: 17px; zoom: 1; color: #0e66ba; background-position: no-repeat no-repeat;"&gt;to='someone@work.com&lt;/A&gt;&lt;SPAN style="background-color: #ffffff;"&gt;' &lt;STRONG&gt;ct='text/html';&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Dec 2011 15:46:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Send-results-of-PROC-SQL-in-an-e-mail-automatically/m-p/9846#M801</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2011-12-07T15:46:38Z</dc:date>
    </item>
    <item>
      <title>Send results of PROC SQL in an e-mail automatically</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Send-results-of-PROC-SQL-in-an-e-mail-automatically/m-p/9847#M802</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks FriedEgg (Good name BTW:smileygrin:), it helped me a great deal, but its sending me the output (HTML format) embedded in the mail, not as an attachment. Any help on that would be great!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Dec 2011 10:19:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Send-results-of-PROC-SQL-in-an-e-mail-automatically/m-p/9847#M802</guid>
      <dc:creator>DrZenith</dc:creator>
      <dc:date>2011-12-08T10:19:30Z</dc:date>
    </item>
    <item>
      <title>Send results of PROC SQL in an e-mail automatically</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Send-results-of-PROC-SQL-in-an-e-mail-automatically/m-p/9848#M803</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; If you are using the default MAPI email interface, you need to switch to using SMTP email in order to include HTML formatted email in the body of the message.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Dec 2011 14:03:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Send-results-of-PROC-SQL-in-an-e-mail-automatically/m-p/9848#M803</guid>
      <dc:creator>polingjw</dc:creator>
      <dc:date>2011-12-08T14:03:59Z</dc:date>
    </item>
    <item>
      <title>Send results of PROC SQL in an e-mail automatically</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Send-results-of-PROC-SQL-in-an-e-mail-automatically/m-p/9849#M804</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oh, you want to send as attachment....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;filename tmp temp;&lt;/P&gt;&lt;P&gt;%let afile=%sysfunc(pathname(tmp));&lt;/P&gt;&lt;P&gt;filename eml email&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:to='mkastin@i-behavior.com"&gt;to='mkastin@i-behavior.com&lt;/A&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; subject='attach something'&lt;/P&gt;&lt;P&gt; attach=("&amp;amp;afile" ct='text/html' name='procsql_results' ext='html');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ods html body=tmp;&lt;/P&gt;&lt;P&gt; proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp; select * from sashelp.class;&lt;/P&gt;&lt;P&gt; quit;&lt;/P&gt;&lt;P&gt;ods html close;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt; file eml;&lt;/P&gt;&lt;P&gt;&amp;nbsp; put "It's done";&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Dec 2011 16:47:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Send-results-of-PROC-SQL-in-an-e-mail-automatically/m-p/9849#M804</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2011-12-08T16:47:44Z</dc:date>
    </item>
    <item>
      <title>Re: Send results of PROC SQL in an e-mail automatically</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Send-results-of-PROC-SQL-in-an-e-mail-automatically/m-p/435091#M68932</link>
      <description>&lt;P&gt;Thank you very much sir,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there possible to add a logic check only sent email if the sql return&amp;nbsp;is not null?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Feb 2018 22:11:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Send-results-of-PROC-SQL-in-an-e-mail-automatically/m-p/435091#M68932</guid>
      <dc:creator>murphykobe</dc:creator>
      <dc:date>2018-02-07T22:11:43Z</dc:date>
    </item>
  </channel>
</rss>

