<?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: Naming the SAS Log Using a Date Macro in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Naming-the-SAS-Log-Using-a-Date-Macro/m-p/497138#M131661</link>
    <description>&lt;P&gt;All the time I spent pouring over this...&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I knew it'd be something simple. Thank You!!!&lt;/P&gt;</description>
    <pubDate>Wed, 19 Sep 2018 20:45:41 GMT</pubDate>
    <dc:creator>Estelle</dc:creator>
    <dc:date>2018-09-19T20:45:41Z</dc:date>
    <item>
      <title>Naming the SAS Log Using a Date Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Naming-the-SAS-Log-Using-a-Date-Macro/m-p/497080#M131630</link>
      <description>&lt;P&gt;I am successfully creating date macros, as seen from the put statement in the log. The odd thing is, I'm trying to append my log file name with these date macros and it is just plum not resolving in the log file name.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All of the following dates resolve just fine:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%LET DATE = %SYSFUNC(DATE(),DATE10.);&lt;BR /&gt;%LET HR = %SYSFUNC(SUBSTR(&amp;amp;TIME, 1, 2));&lt;BR /&gt;%LET MIN = %SYSFUNC(SUBSTR(&amp;amp;TIME, 4, 2));&lt;BR /&gt;%LET SEC = %SYSFUNC(SUBSTR(&amp;amp;TIME, 7, 2));&lt;/P&gt;&lt;P&gt;%PUT DATE = &amp;amp;DATE;&lt;BR /&gt;%PUT = &amp;amp;HR.;&lt;BR /&gt;%PUT = &amp;amp;MIN.;&lt;BR /&gt;%PUT = &amp;amp;SEC.;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And then I try to resolve macros within the log filename which doesn't work:&lt;/P&gt;&lt;P&gt;proc printto log = '\\sasprod\Finance\HealthAnalytics\Projects\Mental_Health_Build\Logs\MH_BUILD_&amp;amp;DATE&amp;amp;HR&amp;amp;MIN&amp;amp;SEC..log';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried many different variations of date macros that will resolve in the put statement and then not in the log.&amp;nbsp; I end up with filename MH_BUILD_&amp;amp;DATE&amp;amp;HR&amp;amp;MIN&amp;amp;SEC or whatever other unresolved date macro names I've tried creating.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Help much appreciated.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Sep 2018 18:25:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Naming-the-SAS-Log-Using-a-Date-Macro/m-p/497080#M131630</guid>
      <dc:creator>Estelle</dc:creator>
      <dc:date>2018-09-19T18:25:47Z</dc:date>
    </item>
    <item>
      <title>Re: Naming the SAS Log Using a Date Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Naming-the-SAS-Log-Using-a-Date-Macro/m-p/497081#M131631</link>
      <description>&lt;P&gt;Use double quotes - " " instead of single.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Sep 2018 18:27:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Naming-the-SAS-Log-Using-a-Date-Macro/m-p/497081#M131631</guid>
      <dc:creator>collinelliot</dc:creator>
      <dc:date>2018-09-19T18:27:52Z</dc:date>
    </item>
    <item>
      <title>Re: Naming the SAS Log Using a Date Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Naming-the-SAS-Log-Using-a-Date-Macro/m-p/497118#M131650</link>
      <description>&lt;P&gt;If you ran your program as a batch job then you can easily get a time-stamped SAS log file without doing any extra SAS coding.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Sep 2018 20:22:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Naming-the-SAS-Log-Using-a-Date-Macro/m-p/497118#M131650</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2018-09-19T20:22:18Z</dc:date>
    </item>
    <item>
      <title>Re: Naming the SAS Log Using a Date Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Naming-the-SAS-Log-Using-a-Date-Macro/m-p/497138#M131661</link>
      <description>&lt;P&gt;All the time I spent pouring over this...&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I knew it'd be something simple. Thank You!!!&lt;/P&gt;</description>
      <pubDate>Wed, 19 Sep 2018 20:45:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Naming-the-SAS-Log-Using-a-Date-Macro/m-p/497138#M131661</guid>
      <dc:creator>Estelle</dc:creator>
      <dc:date>2018-09-19T20:45:41Z</dc:date>
    </item>
    <item>
      <title>Re: Naming the SAS Log Using a Date Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Naming-the-SAS-Log-Using-a-Date-Macro/m-p/497140#M131662</link>
      <description>&lt;P&gt;I miss batch. It's not used in my current position.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Sep 2018 20:46:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Naming-the-SAS-Log-Using-a-Date-Macro/m-p/497140#M131662</guid>
      <dc:creator>Estelle</dc:creator>
      <dc:date>2018-09-19T20:46:38Z</dc:date>
    </item>
  </channel>
</rss>

