<?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: How to get last modified time of file while using infile statement? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-last-modified-time-of-file-while-using-infile/m-p/714182#M220454</link>
    <description>Very useful and quick, thanks.</description>
    <pubDate>Tue, 26 Jan 2021 08:17:25 GMT</pubDate>
    <dc:creator>whymath</dc:creator>
    <dc:date>2021-01-26T08:17:25Z</dc:date>
    <item>
      <title>How to get last modified time of file while using infile statement?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-last-modified-time-of-file-while-using-infile/m-p/714177#M220449</link>
      <description>&lt;P&gt;I am going to analyze a batch of SAS program file and I am stucked in getting the last modified time of program files. I have thought about X command but it was too inefficient.&lt;/P&gt;
&lt;P&gt;I just find when I use infile statement:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
  infile 'D:\test.txt' truncover;
  input ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Log shows the last modified time:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;NOTE: The infile 'D:\test.txt' is:
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Filename=D:\test.txt,
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; RECFM=V,LRECL=32767,File Size (bytes)=7,
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Last Modified=2021/1/26 15:25:48,
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Create Time=2021/1/26 15:25:42&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt; As you can see, log window shows the infomation of file as a NOTE.&amp;nbsp;&lt;SPAN&gt;However,&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;my wish output is a variable filled with Last Modified Time&lt;/STRONG&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;Is there some option to get it while using `infile` statement? Surely, Other efficient ways are welcomed, too.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2021 08:00:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-last-modified-time-of-file-while-using-infile/m-p/714177#M220449</guid>
      <dc:creator>whymath</dc:creator>
      <dc:date>2021-01-26T08:00:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to get last modified time of file while using infile statement?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-last-modified-time-of-file-while-using-infile/m-p/714181#M220453</link>
      <description>&lt;P&gt;Check next code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename fname 'D:\test.txt' truncover;
data _null_;
    fid = fopen('fname');
    if fid then do;
       fattr = finfo(fid,'Last Modified'); 
       lm = input(fattr,datetime18.);  /* lm = Last Modified datetime */
       /* add any other required code */
   end;
   else put '*** Cannot open the file ***';
run;
      
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 26 Jan 2021 08:15:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-last-modified-time-of-file-while-using-infile/m-p/714181#M220453</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2021-01-26T08:15:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to get last modified time of file while using infile statement?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-last-modified-time-of-file-while-using-infile/m-p/714182#M220454</link>
      <description>Very useful and quick, thanks.</description>
      <pubDate>Tue, 26 Jan 2021 08:17:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-last-modified-time-of-file-while-using-infile/m-p/714182#M220454</guid>
      <dc:creator>whymath</dc:creator>
      <dc:date>2021-01-26T08:17:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to get last modified time of file while using infile statement?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-last-modified-time-of-file-while-using-infile/m-p/714188#M220457</link>
      <description>&lt;P&gt;You could use something like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename chk "YOUR_FILE";

data moddates;
   set sashelp.vextfl;
   where upcase(fileref) = 'CHK';

   keep xpath modate;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 26 Jan 2021 08:33:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-last-modified-time-of-file-while-using-infile/m-p/714188#M220457</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2021-01-26T08:33:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to get last modified time of file while using infile statement?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-last-modified-time-of-file-while-using-infile/m-p/714192#M220458</link>
      <description>It works too.</description>
      <pubDate>Tue, 26 Jan 2021 08:42:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-last-modified-time-of-file-while-using-infile/m-p/714192#M220458</guid>
      <dc:creator>whymath</dc:creator>
      <dc:date>2021-01-26T08:42:02Z</dc:date>
    </item>
  </channel>
</rss>

