<?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: SAS Last Date Modified in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-Last-Date-Modified/m-p/288500#M269957</link>
    <description>&lt;PRE&gt;
Or Dictionary table .




filename xx '/folders/myfolders/xx.rtf';
proc sql;
select * 
 from dictionary.EXTFILES
  where fileref='XX';
quit;




&lt;/PRE&gt;</description>
    <pubDate>Mon, 01 Aug 2016 09:41:06 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2016-08-01T09:41:06Z</dc:date>
    <item>
      <title>SAS Last Date Modified</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Last-Date-Modified/m-p/288453#M269950</link>
      <description>&lt;P&gt;Hi, I am trying to get the last date modified for an EXCEL sheet, however the returned value is blank not sure why. I am running the following bit of code on SAS 9.4.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
%let specname = XXX99999 Mapping v0.1;

%let rc = %sysfunc(filename(onefile, %str(.\Docs\&amp;amp;specname..xls))));
%let fid = %sysfunc(fopen(&amp;amp;onefile.));
%let modifydt = %sysfunc(finfo(&amp;amp;fid, Last Modified));
%let fidc = %sysfunc(fclose(&amp;amp;fid.));
%let rc = %sysfunc(filename(onefile));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The log then shows this,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;SYMBOLGEN: Macro variable MODIFYDT resolves to&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any ideas why this may happen?&lt;/P&gt;</description>
      <pubDate>Mon, 01 Aug 2016 08:03:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Last-Date-Modified/m-p/288453#M269950</guid>
      <dc:creator>craig159753</dc:creator>
      <dc:date>2016-08-01T08:03:25Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Last Date Modified</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Last-Date-Modified/m-p/288454#M269951</link>
      <description>&lt;P&gt;I think it's LAST MODIFIED &amp;nbsp;for FINFO?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/hostwin/67962/HTML/default/viewer.htm#n0vegoaf5t6s31n1wu1qok4swqye.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/hostwin/67962/HTML/default/viewer.htm#n0vegoaf5t6s31n1wu1qok4swqye.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Aug 2016 07:15:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Last-Date-Modified/m-p/288454#M269951</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-08-01T07:15:56Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Last Date Modified</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Last-Date-Modified/m-p/288455#M269952</link>
      <description>&lt;P&gt;I find it MUCH more convenient to avoid the %sysfunc and %str hailstorm by using a data _null_ step:&lt;/P&gt;
&lt;P&gt;(This is UNIX, of course)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
rc = filename("onefile","$HOME/test.txt");
fid = fopen("onefile");
modifydt = finfo(fid,"Last Modified");
call symput('modifydt',modifydt);
run;

%put &amp;amp;modifydt.;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The correct parameter for the finfo function is "Last Modified", as per &lt;A href="http://support.sas.com/documentation/cdl/en/hostwin/67962/HTML/default/viewer.htm#n0vegoaf5t6s31n1wu1qok4swqye.htm" target="_blank"&gt;FINFO Function: Windows&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Result here:&lt;/P&gt;
&lt;PRE&gt;16         data _null_;
17         rc = filename("onefile","$HOME/test.txt");
18         fid = fopen("onefile");
19         modifydt = finfo(fid,"Last Modified");
20         call symput('modifydt',modifydt);
21         run;

NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

22         
23         %put &amp;amp;modifydt.;
Tue Jun 28 08:53:29 2016
&lt;/PRE&gt;</description>
      <pubDate>Mon, 01 Aug 2016 07:22:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Last-Date-Modified/m-p/288455#M269952</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-08-01T07:22:00Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Last Date Modified</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Last-Date-Modified/m-p/288464#M269953</link>
      <description>&lt;P&gt;Sorry I have updated this, I left this in by mistake, when I use Last my result is still null :S&lt;/P&gt;</description>
      <pubDate>Mon, 01 Aug 2016 08:06:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Last-Date-Modified/m-p/288464#M269953</guid>
      <dc:creator>craig159753</dc:creator>
      <dc:date>2016-08-01T08:06:30Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Last Date Modified</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Last-Date-Modified/m-p/288471#M269954</link>
      <description>&lt;P&gt;This worked, I added a bit of code to change the format though&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;modifydt = finfo(fid,"Last Modified");&lt;BR /&gt; lastmodified = input((trim(scan(modifydt, 1, " ") || substrn(scan(modifydt, 2, " "), 1, 3) || scan(modifydt, 3, " ")) || ":" || scan(modifydt, 4, " ")), datetime20.);&lt;/P&gt;</description>
      <pubDate>Mon, 01 Aug 2016 08:25:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Last-Date-Modified/m-p/288471#M269954</guid>
      <dc:creator>craig159753</dc:creator>
      <dc:date>2016-08-01T08:25:07Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Last Date Modified</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Last-Date-Modified/m-p/288484#M269955</link>
      <description>&lt;P&gt;Hi, quick question how do I close the file? I tired&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;fid = fclose ("onefile");&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But it doesnt work&lt;/P&gt;</description>
      <pubDate>Mon, 01 Aug 2016 08:58:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Last-Date-Modified/m-p/288484#M269955</guid>
      <dc:creator>craig159753</dc:creator>
      <dc:date>2016-08-01T08:58:52Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Last Date Modified</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Last-Date-Modified/m-p/288487#M269956</link>
      <description>&lt;P&gt;To close the file and reset the file reference, do&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;rc = fclose(fid);
rc = filename("onefile");
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 01 Aug 2016 09:02:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Last-Date-Modified/m-p/288487#M269956</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-08-01T09:02:17Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Last Date Modified</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Last-Date-Modified/m-p/288500#M269957</link>
      <description>&lt;PRE&gt;
Or Dictionary table .




filename xx '/folders/myfolders/xx.rtf';
proc sql;
select * 
 from dictionary.EXTFILES
  where fileref='XX';
quit;




&lt;/PRE&gt;</description>
      <pubDate>Mon, 01 Aug 2016 09:41:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Last-Date-Modified/m-p/288500#M269957</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-08-01T09:41:06Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Last Date Modified</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Last-Date-Modified/m-p/288504#M269958</link>
      <description>&lt;PRE&gt;
Or querying Dictionary table .

filename xx '/folders/myfolders/xx.rtf';
proc sql;
select * 
 from dictionary.EXTFILES
  where fileref='XX';
quit;




&lt;/PRE&gt;</description>
      <pubDate>Mon, 01 Aug 2016 09:53:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Last-Date-Modified/m-p/288504#M269958</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-08-01T09:53:09Z</dc:date>
    </item>
  </channel>
</rss>

