<?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 SAS Tip: Adding a date and time stamp message to the SAS Log in SAS Tips from the Community</title>
    <link>https://communities.sas.com/t5/SAS-Tips-from-the-Community/SAS-Tip-Adding-a-date-and-time-stamp-message-to-the-SAS-Log/m-p/475840#M180</link>
    <description>&lt;P&gt;SAS&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;listing output contains date and time stamps at the top of each output page. However, the associated&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;SAS logs&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;do not. You can however add a date time stamp to the LOG using a couple of different methods.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="mw-geshi mw-code mw-content-ltr" dir="ltr"&gt;
&lt;DIV class="sas source-sas"&gt;
&lt;PRE class="de1"&gt;&lt;SPAN class="coMULTI"&gt;* DATA Step;&lt;/SPAN&gt;
&lt;SPAN class="kw6"&gt;data&lt;/SPAN&gt; &lt;SPAN class="kw1"&gt;_null_&lt;/SPAN&gt;;  
    &lt;SPAN class="kw3"&gt;datetime&lt;/SPAN&gt; = &lt;SPAN class="kw3"&gt;datetime&lt;/SPAN&gt;&lt;SPAN class="br0"&gt;(&lt;/SPAN&gt;&lt;SPAN class="br0"&gt;)&lt;/SPAN&gt;;
    &lt;SPAN class="kw3"&gt;put&lt;/SPAN&gt; &lt;SPAN class="kw3"&gt;datetime&lt;/SPAN&gt;= datetime18.;
&lt;SPAN class="kw6"&gt;run&lt;/SPAN&gt;;&lt;/PRE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;Or you can use the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;macro language.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="mw-geshi mw-code mw-content-ltr" dir="ltr"&gt;
&lt;DIV class="sas source-sas"&gt;
&lt;PRE class="de1"&gt;&lt;SPAN class="kw2"&gt;%put&lt;/SPAN&gt; Job Started Execution at &lt;SPAN class="kw2"&gt;%sysfunc&lt;/SPAN&gt;&lt;SPAN class="br0"&gt;(&lt;/SPAN&gt;&lt;SPAN class="kw3"&gt;time&lt;/SPAN&gt;&lt;SPAN class="br0"&gt;(&lt;/SPAN&gt;&lt;SPAN class="br0"&gt;)&lt;/SPAN&gt;,timeampm.&lt;SPAN class="br0"&gt;)&lt;/SPAN&gt; &lt;SPAN class="kw4"&gt;on&lt;/SPAN&gt; &lt;SPAN class="kw2"&gt;%sysfunc&lt;/SPAN&gt;&lt;SPAN class="br0"&gt;(&lt;/SPAN&gt;&lt;SPAN class="kw3"&gt;date&lt;/SPAN&gt;&lt;SPAN class="br0"&gt;(&lt;/SPAN&gt;&lt;SPAN class="br0"&gt;)&lt;/SPAN&gt;,worddate.&lt;SPAN class="br0"&gt;)&lt;/SPAN&gt;.;&lt;/PRE&gt;
&lt;P&gt;&lt;EM&gt;Originally posted by Lpweaver on sasCommunity.org.&lt;/EM&gt;&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
    <pubDate>Fri, 06 Jul 2018 19:48:33 GMT</pubDate>
    <dc:creator>SAS_Tipster</dc:creator>
    <dc:date>2018-07-06T19:48:33Z</dc:date>
    <item>
      <title>SAS Tip: Adding a date and time stamp message to the SAS Log</title>
      <link>https://communities.sas.com/t5/SAS-Tips-from-the-Community/SAS-Tip-Adding-a-date-and-time-stamp-message-to-the-SAS-Log/m-p/475840#M180</link>
      <description>&lt;P&gt;SAS&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;listing output contains date and time stamps at the top of each output page. However, the associated&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;SAS logs&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;do not. You can however add a date time stamp to the LOG using a couple of different methods.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="mw-geshi mw-code mw-content-ltr" dir="ltr"&gt;
&lt;DIV class="sas source-sas"&gt;
&lt;PRE class="de1"&gt;&lt;SPAN class="coMULTI"&gt;* DATA Step;&lt;/SPAN&gt;
&lt;SPAN class="kw6"&gt;data&lt;/SPAN&gt; &lt;SPAN class="kw1"&gt;_null_&lt;/SPAN&gt;;  
    &lt;SPAN class="kw3"&gt;datetime&lt;/SPAN&gt; = &lt;SPAN class="kw3"&gt;datetime&lt;/SPAN&gt;&lt;SPAN class="br0"&gt;(&lt;/SPAN&gt;&lt;SPAN class="br0"&gt;)&lt;/SPAN&gt;;
    &lt;SPAN class="kw3"&gt;put&lt;/SPAN&gt; &lt;SPAN class="kw3"&gt;datetime&lt;/SPAN&gt;= datetime18.;
&lt;SPAN class="kw6"&gt;run&lt;/SPAN&gt;;&lt;/PRE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;Or you can use the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;macro language.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="mw-geshi mw-code mw-content-ltr" dir="ltr"&gt;
&lt;DIV class="sas source-sas"&gt;
&lt;PRE class="de1"&gt;&lt;SPAN class="kw2"&gt;%put&lt;/SPAN&gt; Job Started Execution at &lt;SPAN class="kw2"&gt;%sysfunc&lt;/SPAN&gt;&lt;SPAN class="br0"&gt;(&lt;/SPAN&gt;&lt;SPAN class="kw3"&gt;time&lt;/SPAN&gt;&lt;SPAN class="br0"&gt;(&lt;/SPAN&gt;&lt;SPAN class="br0"&gt;)&lt;/SPAN&gt;,timeampm.&lt;SPAN class="br0"&gt;)&lt;/SPAN&gt; &lt;SPAN class="kw4"&gt;on&lt;/SPAN&gt; &lt;SPAN class="kw2"&gt;%sysfunc&lt;/SPAN&gt;&lt;SPAN class="br0"&gt;(&lt;/SPAN&gt;&lt;SPAN class="kw3"&gt;date&lt;/SPAN&gt;&lt;SPAN class="br0"&gt;(&lt;/SPAN&gt;&lt;SPAN class="br0"&gt;)&lt;/SPAN&gt;,worddate.&lt;SPAN class="br0"&gt;)&lt;/SPAN&gt;.;&lt;/PRE&gt;
&lt;P&gt;&lt;EM&gt;Originally posted by Lpweaver on sasCommunity.org.&lt;/EM&gt;&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Fri, 06 Jul 2018 19:48:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Tips-from-the-Community/SAS-Tip-Adding-a-date-and-time-stamp-message-to-the-SAS-Log/m-p/475840#M180</guid>
      <dc:creator>SAS_Tipster</dc:creator>
      <dc:date>2018-07-06T19:48:33Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Tip: Adding a date and time stamp message to the SAS Log</title>
      <link>https://communities.sas.com/t5/SAS-Tips-from-the-Community/SAS-Tip-Adding-a-date-and-time-stamp-message-to-the-SAS-Log/m-p/475863#M181</link>
      <description>&lt;P&gt;The SAS log does have the date and time at the top.&lt;/P&gt;
&lt;PRE&gt;1                                                          The SAS System                                 09:42 Monday, May 14, 2018

NOTE: Copyright (c) 2016 by SAS Institute Inc., Cary, NC, USA. 
NOTE: SAS (r) Proprietary Software 9.4 (TS1M5) 
      Licensed to XXX, Site ###.
NOTE: This session is executing on the ZZZ platform.
&lt;/PRE&gt;
&lt;P&gt;But perhaps this is intended for SAS/Studio or other processing where the the full log is not normally provided?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also note that the DATETIME18. format is broken.&amp;nbsp; It should have room for 4 digit years, but it only displays the last 2 digits of the year.&amp;nbsp; So either use DATETIME19. to get 4 digit years or use DATETIME16. if you only need 2 digit years.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jul 2018 23:02:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Tips-from-the-Community/SAS-Tip-Adding-a-date-and-time-stamp-message-to-the-SAS-Log/m-p/475863#M181</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-07-05T23:02:45Z</dc:date>
    </item>
  </channel>
</rss>

