<?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 How to add current date time in log file name? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-current-date-time-in-log-file-name/m-p/435198#M108084</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my sample program&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc printto log='/Desktop/alternate-log-file.log';

run;

Data test;

Input ID name $ Amount;

Datalines;

 

1 A 10

2 B 20

3 C 30

4 D 40

5 E 50

;

Run;

proc printto;

run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to know how can I add current date and time timestamp in the name "&lt;FONT color="#800080" face="Courier New"&gt;alternate-log-file.log&lt;/FONT&gt;"?&lt;/P&gt;&lt;P&gt;Any suggestion.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sourav&lt;/P&gt;</description>
    <pubDate>Thu, 08 Feb 2018 09:21:21 GMT</pubDate>
    <dc:creator>Sourav_sas</dc:creator>
    <dc:date>2018-02-08T09:21:21Z</dc:date>
    <item>
      <title>How to add current date time in log file name?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-current-date-time-in-log-file-name/m-p/435198#M108084</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my sample program&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc printto log='/Desktop/alternate-log-file.log';

run;

Data test;

Input ID name $ Amount;

Datalines;

 

1 A 10

2 B 20

3 C 30

4 D 40

5 E 50

;

Run;

proc printto;

run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to know how can I add current date and time timestamp in the name "&lt;FONT color="#800080" face="Courier New"&gt;alternate-log-file.log&lt;/FONT&gt;"?&lt;/P&gt;&lt;P&gt;Any suggestion.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sourav&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2018 09:21:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-current-date-time-in-log-file-name/m-p/435198#M108084</guid>
      <dc:creator>Sourav_sas</dc:creator>
      <dc:date>2018-02-08T09:21:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to add current date time in log file name?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-current-date-time-in-log-file-name/m-p/435201#M108085</link>
      <description>&lt;P&gt;What type of timestamp, there are various formats. E.g.&lt;/P&gt;
&lt;PRE&gt;proc printto log="/desktop/alternate_log_file_%sysfunc(now(),datetime.).log";

proc printto log="/desktop/alternate_log_file_%sysfunc(date(),date9.).log";

proc printto log="/desktop/alternate_log_file_%sysfunc(date(),e8601dt.).log";
&lt;/PRE&gt;</description>
      <pubDate>Thu, 08 Feb 2018 09:47:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-current-date-time-in-log-file-name/m-p/435201#M108085</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-02-08T09:47:08Z</dc:date>
    </item>
  </channel>
</rss>

