<?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: Error in mail in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Error-in-mail/m-p/186579#M35325</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank You very much for your great help.&lt;/P&gt;&lt;P&gt;One question&lt;/P&gt;&lt;P&gt;How to add the current date in the subject of text. Its not working. Can you please help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Subject='Test Mail message__&amp;amp;print_date'&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 02 Jan 2014 20:21:23 GMT</pubDate>
    <dc:creator>Abraham</dc:creator>
    <dc:date>2014-01-02T20:21:23Z</dc:date>
    <item>
      <title>Error in mail</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-in-mail/m-p/186577#M35323</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to send mail to a particular user by attaching excel file with current date from a particular location . But I am getting error while running the below program.&lt;/P&gt;&lt;P&gt;Can anyone help me as I am not experienced. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Location of Excel file: - 'C:\Program Files\Cisco\Meddra term updated_03JAN2013.XLS'&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 Mailbox EMAIL &lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:'manager@cisco.com"&gt;'manager@cisco.com&lt;/A&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; Subject='Test Mail message'&lt;/P&gt;&lt;P&gt;ATTACH= 'C:\Program Files\Cisco\Meddra term updated_||put("&amp;amp;sysdate9"d ,date9.)||".xls"'&lt;/P&gt;&lt;P&gt;; &lt;/P&gt;&lt;P&gt;DATA _NULL_;&lt;/P&gt;&lt;P&gt;FILE Mailbox;&lt;/P&gt;&lt;P&gt;PUT "Hello";&lt;/P&gt;&lt;P&gt;PUT "Test mail ";&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;N:B: The excel output file will be updated with current date everyday in the above location. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jan 2014 19:35:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-in-mail/m-p/186577#M35323</guid>
      <dc:creator>Abraham</dc:creator>
      <dc:date>2014-01-02T19:35:47Z</dc:date>
    </item>
    <item>
      <title>Re: Error in mail</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-in-mail/m-p/186578#M35324</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First question: You have set up your email setting through your .cfg file correct? My guess is yes bc it sounds like this is just a question about how to get it to go from the correct date. If not you will first need to set that up so you can email from SAS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Second: run this line of code before the filename statement&lt;/P&gt;&lt;P&gt;%let print_date = %sysfunc(today(), date9.);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Third: You will need a from=("&lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:you@you.org"&gt;you@you.org&lt;/A&gt;&lt;SPAN&gt;") to=("&lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:manager@cisco.org"&gt;manager@cisco.org&lt;/A&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fourth: You then can run it write the attach statement as such:&lt;/P&gt;&lt;P&gt;ATTACH= "C:\Program Files\Cisco\Meddra term updated_&amp;amp;print_date..xls"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since you previously had stated what the print_date macro should output you then can just insert it into the attach statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the end the code should look like this:&lt;/P&gt;&lt;P&gt;%let print_date = %sysfunc(today(), date9.);&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;FILENAME Mailbox EMAIL from=("&lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:you@you.org"&gt;you@you.org&lt;/A&gt;&lt;SPAN&gt;") &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;to=("&lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:manager@cisco.org"&gt;manager@cisco.org&lt;/A&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;ATTACH= "C:\Program Files\Cisco\Meddra term updated_&amp;amp;print_date..xls"&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;DATA _NULL_;&lt;/P&gt;&lt;P&gt;FILE Mailbox;&lt;/P&gt;&lt;P&gt;PUT "Hello";&lt;/P&gt;&lt;P&gt;PUT "Test mail ";&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jan 2014 19:58:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-in-mail/m-p/186578#M35324</guid>
      <dc:creator>overmar</dc:creator>
      <dc:date>2014-01-02T19:58:31Z</dc:date>
    </item>
    <item>
      <title>Re: Error in mail</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-in-mail/m-p/186579#M35325</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank You very much for your great help.&lt;/P&gt;&lt;P&gt;One question&lt;/P&gt;&lt;P&gt;How to add the current date in the subject of text. Its not working. Can you please help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Subject='Test Mail message__&amp;amp;print_date'&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jan 2014 20:21:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-in-mail/m-p/186579#M35325</guid>
      <dc:creator>Abraham</dc:creator>
      <dc:date>2014-01-02T20:21:23Z</dc:date>
    </item>
    <item>
      <title>Re: Error in mail</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-in-mail/m-p/186580#M35326</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Put " rather than ' in that line of code, macros don't like running in single quotes&lt;/P&gt;&lt;P&gt;so subject should be&lt;/P&gt;&lt;P&gt;Subject="Test Mail message_&amp;amp;print_date"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jan 2014 20:25:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-in-mail/m-p/186580#M35326</guid>
      <dc:creator>overmar</dc:creator>
      <dc:date>2014-01-02T20:25:14Z</dc:date>
    </item>
    <item>
      <title>Re: Error in mail</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-in-mail/m-p/186581#M35327</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Its working fine now. I forgot to ask one more question .&lt;/P&gt;&lt;P&gt;If I want to attach multiple file , then can I write like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;ATTACH= ("C:\Program Files\Cisco\Meddra term updated_&amp;amp;print_date..xls"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&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; "&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;C:\Program Files\Cisco\Meddra term updated_&amp;amp;print_date..&lt;/SPAN&gt;pdf"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&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; "&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;C:\Program Files\Cisco\Meddra term updated_&amp;amp;print_date..&lt;/SPAN&gt;doc"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&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; )&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jan 2014 20:40:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-in-mail/m-p/186581#M35327</guid>
      <dc:creator>Abraham</dc:creator>
      <dc:date>2014-01-02T20:40:58Z</dc:date>
    </item>
    <item>
      <title>Re: Error in mail</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-in-mail/m-p/186582#M35328</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Correct and make sure to put the parentheses outside of the file names, they are not required if you are only sending one file, but are if you are sending multiple ones.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jan 2014 21:26:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-in-mail/m-p/186582#M35328</guid>
      <dc:creator>overmar</dc:creator>
      <dc:date>2014-01-02T21:26:17Z</dc:date>
    </item>
  </channel>
</rss>

