<?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 Read Log Date/Time Stamps in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Read-Log-Date-Time-Stamps/m-p/366145#M87071</link>
    <description>&lt;P&gt;I need some code to all read log date/time stamps in a folder (or several folders)&amp;nbsp;on a Unix system. I find plenty for Windows-based systems but not for Unix.&lt;/P&gt;</description>
    <pubDate>Mon, 12 Jun 2017 13:42:34 GMT</pubDate>
    <dc:creator>Doug____</dc:creator>
    <dc:date>2017-06-12T13:42:34Z</dc:date>
    <item>
      <title>Read Log Date/Time Stamps</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-Log-Date-Time-Stamps/m-p/366145#M87071</link>
      <description>&lt;P&gt;I need some code to all read log date/time stamps in a folder (or several folders)&amp;nbsp;on a Unix system. I find plenty for Windows-based systems but not for Unix.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jun 2017 13:42:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-Log-Date-Time-Stamps/m-p/366145#M87071</guid>
      <dc:creator>Doug____</dc:creator>
      <dc:date>2017-06-12T13:42:34Z</dc:date>
    </item>
    <item>
      <title>Re: Read Log Date/Time Stamps</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-Log-Date-Time-Stamps/m-p/366149#M87074</link>
      <description>&lt;P&gt;Do you need the "last modified" timestamps of files?&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jun 2017 13:51:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-Log-Date-Time-Stamps/m-p/366149#M87074</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-06-12T13:51:14Z</dc:date>
    </item>
    <item>
      <title>Re: Read Log Date/Time Stamps</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-Log-Date-Time-Stamps/m-p/366153#M87077</link>
      <description>&lt;P&gt;Yes the last date/time modified that is correct.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jun 2017 13:56:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-Log-Date-Time-Stamps/m-p/366153#M87077</guid>
      <dc:creator>Doug____</dc:creator>
      <dc:date>2017-06-12T13:56:38Z</dc:date>
    </item>
    <item>
      <title>Re: Read Log Date/Time Stamps</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-Log-Date-Time-Stamps/m-p/366161#M87080</link>
      <description>&lt;P&gt;This is a code snippet I use to read the modification date from a directory listing.&lt;/P&gt;
&lt;P&gt;Note that on a simple ls -l, you'll get the modification time for files less than 6 months old, or the year for older files in the same column. So my code replaces the time with the correct year.&lt;/P&gt;
&lt;P&gt;You might need to adapt the column pointers in the input statement, this works with AIX.&lt;/P&gt;
&lt;P&gt;The first part reads the listing into a temporary file and records messages from that in the SAS log.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename oscmd pipe "ls -l &amp;amp;pathname &amp;gt; $HOME/files.lst 2&amp;gt;&amp;amp;1";

data _null_;
infile oscmd;
input;
put _infile_;
run;

data filenames (keep=userid datum f_name);
infile '$HOME/files.lst';
length
  userid $ 8
  zzeit $ 5
  monat $ 3
  tag $ 2
  f_name $ 100
;
format datum ddmmyyp10.;
input
  @17 userid $8.
  @46 monat
  @50 tag
  @53 zzeit $5.
  @59 f_name
;
if substr(zzeit,3,1) = ':'
then do;
  if monat in ('Jul','Aug','Sep','Oct','Nov','Dec')
  then zzeit = put(year(&amp;amp;tagesdat)-1,z4.);
  else zzeit = put(year(&amp;amp;tagesdat),z4.);
end;
mo = (index('JanFebMarAprMayJunJulAugSepOctNovDec',monat) + 2) / 3;
datum = input(substr(zzeit,1,4) !! put(mo,z2.) !! tag, yymmdd8.);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you need a scan through a whole directory tree, use the UNIX find command with the -ls directive and adapt the column pointers to the resulting format.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jun 2017 14:26:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-Log-Date-Time-Stamps/m-p/366161#M87080</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-06-12T14:26:47Z</dc:date>
    </item>
    <item>
      <title>Re: Read Log Date/Time Stamps</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-Log-Date-Time-Stamps/m-p/366178#M87089</link>
      <description>&lt;P&gt;Kurt - code works ok - what is this macro variable&lt;/P&gt;&lt;P&gt;&amp;amp;tagesdat?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jun 2017 14:58:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-Log-Date-Time-Stamps/m-p/366178#M87089</guid>
      <dc:creator>Doug____</dc:creator>
      <dc:date>2017-06-12T14:58:04Z</dc:date>
    </item>
    <item>
      <title>Re: Read Log Date/Time Stamps</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-Log-Date-Time-Stamps/m-p/366180#M87091</link>
      <description>&lt;P&gt;Ups, sorry, it's basically today(). You can safely replace it by this.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jun 2017 15:01:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-Log-Date-Time-Stamps/m-p/366180#M87091</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-06-12T15:01:58Z</dc:date>
    </item>
  </channel>
</rss>

