<?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: SAS Email - Insert a date in the subject line in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Email-Insert-a-date-in-the-subject-line/m-p/150731#M39709</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use a %let statement to create the date and then call it within your subject line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FILENAME MailBox EMAIL ATTACH='TestFile';&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;%LET DATE = %sysfunc( putn( %sysfunc( date() ), MMDDYY10. ));&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;%Put &amp;amp;DATE&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA _NULL_;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; FILE Mailbox TO=(&lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:'Someone@somwhere.com"&gt;'Someone@somwhere.com&lt;/A&gt;&lt;SPAN&gt;')&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; SUBJECT = "Test&lt;STRONG style="text-decoration: underline;"&gt;&amp;amp;Date&lt;/STRONG&gt;" ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; PUT "Test Test Test";&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 18 Sep 2014 16:23:23 GMT</pubDate>
    <dc:creator>tuckeraw</dc:creator>
    <dc:date>2014-09-18T16:23:23Z</dc:date>
    <item>
      <title>SAS Email - Insert a date in the subject line</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Email-Insert-a-date-in-the-subject-line/m-p/150729#M39707</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;I need to insert today's date 09/18/2014 in the email subject line. The email subject line would be "Reports for 09/18/2014". Any help is greatly appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Sep 2014 15:56:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-Email-Insert-a-date-in-the-subject-line/m-p/150729#M39707</guid>
      <dc:creator>Hima</dc:creator>
      <dc:date>2014-09-18T15:56:57Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Email - Insert a date in the subject line</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Email-Insert-a-date-in-the-subject-line/m-p/150730#M39708</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Would something like below work?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;call symputx("today",put(today(),mmddyy10.));&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;%put today=&amp;amp;today;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;options emailsys=smtp emailhost=youremailhost emailport=xx;&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:hima@xyz.com"&gt;hima@xyz.com&lt;/A&gt;&lt;SPAN&gt;";&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; file MailBox TO=("&lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:hima@xyz.com"&gt;hima@xyz.com&lt;/A&gt;&lt;SPAN&gt;" )&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt; CC=("&lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:XXX@xyz.com"&gt;XXX@xyz.com&lt;/A&gt;&lt;SPAN&gt;")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:FROM='hima@xyz.com"&gt;FROM='hima@xyz.com&lt;/A&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:REPLYTO='hima@xyz.com"&gt;REPLYTO='hima@xyz.com&lt;/A&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; SUBJECT="Reports for &amp;amp;today.";&lt;/P&gt;&lt;P&gt; put "Attached are today's reports";&lt;/P&gt;&lt;P&gt; put "Reply with any questions.";&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Sep 2014 16:17:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-Email-Insert-a-date-in-the-subject-line/m-p/150730#M39708</guid>
      <dc:creator>NijeB</dc:creator>
      <dc:date>2014-09-18T16:17:10Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Email - Insert a date in the subject line</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Email-Insert-a-date-in-the-subject-line/m-p/150731#M39709</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use a %let statement to create the date and then call it within your subject line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FILENAME MailBox EMAIL ATTACH='TestFile';&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;%LET DATE = %sysfunc( putn( %sysfunc( date() ), MMDDYY10. ));&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;%Put &amp;amp;DATE&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA _NULL_;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; FILE Mailbox TO=(&lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:'Someone@somwhere.com"&gt;'Someone@somwhere.com&lt;/A&gt;&lt;SPAN&gt;')&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; SUBJECT = "Test&lt;STRONG style="text-decoration: underline;"&gt;&amp;amp;Date&lt;/STRONG&gt;" ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; PUT "Test Test Test";&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Sep 2014 16:23:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-Email-Insert-a-date-in-the-subject-line/m-p/150731#M39709</guid>
      <dc:creator>tuckeraw</dc:creator>
      <dc:date>2014-09-18T16:23:23Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Email - Insert a date in the subject line</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Email-Insert-a-date-in-the-subject-line/m-p/150732#M39710</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How about SUBJECT = "Report for &amp;amp;sysdate"?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Needs no other code, and avoids the problem of MMDDYY and DDMMYY confusion for situations when both MM and DD are &amp;lt;= 12 - the first 12 days of every month.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bill&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Sep 2014 17:36:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-Email-Insert-a-date-in-the-subject-line/m-p/150732#M39710</guid>
      <dc:creator>Bill</dc:creator>
      <dc:date>2014-09-18T17:36:07Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Email - Insert a date in the subject line</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Email-Insert-a-date-in-the-subject-line/m-p/150733#M39711</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I see two issues:&lt;/P&gt;&lt;P&gt;1)Small issue: the format.Solutions involving putn or put go extra miles just to get the format OP asked for.&lt;/P&gt;&lt;P&gt;2)Big issue: &amp;amp;sysdate is the date when your current SAS process fired up, which is not necessarily 'today' , per se.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Haikuo &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Sep 2014 17:54:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-Email-Insert-a-date-in-the-subject-line/m-p/150733#M39711</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2014-09-18T17:54:26Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Email - Insert a date in the subject line</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Email-Insert-a-date-in-the-subject-line/m-p/150734#M39712</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As we move to more and more global applications, the OP request may need to take second place to a format that can't be confused. &lt;/P&gt;&lt;P&gt;You are correct about the big issue - although it's not a problem for batch processing, which is what I had in mind.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Sep 2014 18:57:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-Email-Insert-a-date-in-the-subject-line/m-p/150734#M39712</guid>
      <dc:creator>Bill</dc:creator>
      <dc:date>2014-09-18T18:57:03Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Email - Insert a date in the subject line</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Email-Insert-a-date-in-the-subject-line/m-p/150735#M39713</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;"although it's not a problem for batch processing, which is what I had in mind."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Batch or not, 'sysdate' is still the date when you start up your current batch. It remains the same issue (not being 'today') if your batch runs across the mid-night or as long as the date of the 'email' is not the same as the date when you start your SAS session (batch or interactive).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my2cents,&lt;/P&gt;&lt;P&gt;Haikuo &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Sep 2014 20:38:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-Email-Insert-a-date-in-the-subject-line/m-p/150735#M39713</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2014-09-18T20:38:16Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Email - Insert a date in the subject line</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Email-Insert-a-date-in-the-subject-line/m-p/150736#M39714</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is what I'm using:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data age;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set members14to15;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; format today DATETIME22.3;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; today = today();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; year = year(today());&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; age = year - year(datepart(birth_date));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if birth_date &amp;gt; today then age=age-1;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need the age of a member based on their birth date. The problem is - if a person has NOT had their birthday this year, it's still calculating as if they had. Does this help?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jul 2015 20:49:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-Email-Insert-a-date-in-the-subject-line/m-p/150736#M39714</guid>
      <dc:creator>emmytheduck</dc:creator>
      <dc:date>2015-07-16T20:49:47Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Email - Insert a date in the subject line</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Email-Insert-a-date-in-the-subject-line/m-p/150737#M39715</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Didn't mean to post here. Sorry.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jul 2015 20:59:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-Email-Insert-a-date-in-the-subject-line/m-p/150737#M39715</guid>
      <dc:creator>emmytheduck</dc:creator>
      <dc:date>2015-07-16T20:59:30Z</dc:date>
    </item>
  </channel>
</rss>

