<?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: last modified date of the imported file in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/last-modified-date-of-the-imported-file/m-p/44111#M9029</link>
    <description>try anydtdtm informat&lt;BR /&gt;
Otherwise you have to recombine it into a style easier for the datetime.  informat</description>
    <pubDate>Mon, 06 Dec 2010 19:34:56 GMT</pubDate>
    <dc:creator>Peter_C</dc:creator>
    <dc:date>2010-12-06T19:34:56Z</dc:date>
    <item>
      <title>last modified date of the imported file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/last-modified-date-of-the-imported-file/m-p/44105#M9023</link>
      <description>Hi All,&lt;BR /&gt;
&lt;BR /&gt;
Hi I have automated a process, and I was interested to know whether it is possible to get the last modified date of the file(txt,xls..etc)  which is imported..&lt;BR /&gt;
&lt;BR /&gt;
My problem or rather intention is to validate the file which is getting imported. I mean, I am importing a file from the Server(remote), which is supposed to be replaced or modified everyday by my user. At times it happens that user may not replace the file at the specified time(usually 1 hr prior to sceduled stream), if that is the case I would like to check that the file which is getting imported is a modified file or not by looking at the modified date.&lt;BR /&gt;
&lt;BR /&gt;
Alternatives like telling the business user to give a different name with date..etc are not feasible due to some internal issues.&lt;BR /&gt;
&lt;BR /&gt;
please put your thoughts in..</description>
      <pubDate>Fri, 03 Dec 2010 11:03:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/last-modified-date-of-the-imported-file/m-p/44105#M9023</guid>
      <dc:creator>syam_india_kochi</dc:creator>
      <dc:date>2010-12-03T11:03:53Z</dc:date>
    </item>
    <item>
      <title>Re: last modified date of the imported file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/last-modified-date-of-the-imported-file/m-p/44106#M9024</link>
      <description>Yes, investigate using the SAS FINFO CALL function.  The SAS support website has SAS-hosted documentation and supplemental technical reference material showing examples - as well, you may want to search the archives.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
Suggested Google advanced search argument, this topic / post:&lt;BR /&gt;
&lt;BR /&gt;
last modified date site:sas.com</description>
      <pubDate>Fri, 03 Dec 2010 12:51:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/last-modified-date-of-the-imported-file/m-p/44106#M9024</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-12-03T12:51:32Z</dc:date>
    </item>
    <item>
      <title>Re: last modified date of the imported file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/last-modified-date-of-the-imported-file/m-p/44107#M9025</link>
      <description>Hi &lt;BR /&gt;
&lt;BR /&gt;
Lookup functin FINFO() in the SAS doc.&lt;BR /&gt;
&lt;BR /&gt;
You'll find this example code which is all you need to get started:&lt;BR /&gt;
data info;&lt;BR /&gt;
   length infoname infoval $60;&lt;BR /&gt;
   drop rc fid infonum i close;&lt;BR /&gt;
   rc=filename('abc','physical-filename');&lt;BR /&gt;
   fid=fopen('abc');&lt;BR /&gt;
   infonum=foptnum(fid);&lt;BR /&gt;
   do i=1 to infonum;&lt;BR /&gt;
      infoname=foptname(fid,i);&lt;BR /&gt;
      infoval=finfo(fid,infoname);&lt;BR /&gt;
      output;&lt;BR /&gt;
   end;&lt;BR /&gt;
   close=fclose(fid);&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
Be aware that also other processes like disk backup/restore or a compress could change a create or modified date.&lt;BR /&gt;
&lt;BR /&gt;
An alternative to FINFO would be to directly execute a OS command and then capture the result (i.e. using "filename pipe ...").&lt;BR /&gt;
&lt;BR /&gt;
HTH&lt;BR /&gt;
Patrick

Message was edited by: Patrick</description>
      <pubDate>Fri, 03 Dec 2010 13:12:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/last-modified-date-of-the-imported-file/m-p/44107#M9025</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2010-12-03T13:12:08Z</dc:date>
    </item>
    <item>
      <title>Re: last modified date of the imported file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/last-modified-date-of-the-imported-file/m-p/44108#M9026</link>
      <description>If not already on SAS 9.2 this will encourage your upgrade somewhat.  Before 9.2 the file date is not available through FINFO. Then it was a lot more op.sys- and release-specific to extract the dates.&lt;BR /&gt;
 I'm trying to encourage SAS to provide these pieces of external file information in a simple way through infile options or PROC import. Already some of this is reported to the SAS log  or a macro variable like &amp;amp;dbsysmsg and variants. More could be done for the external files we read with SAS.&lt;BR /&gt;
imho&lt;BR /&gt;
 add your voice through the sasware ballot&lt;BR /&gt;
 &lt;BR /&gt;
peterC</description>
      <pubDate>Fri, 03 Dec 2010 22:25:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/last-modified-date-of-the-imported-file/m-p/44108#M9026</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2010-12-03T22:25:54Z</dc:date>
    </item>
    <item>
      <title>Re: last modified date of the imported file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/last-modified-date-of-the-imported-file/m-p/44109#M9027</link>
      <description>Hi.&lt;BR /&gt;
You can use Filename and PIPE to get the modified date of the file in the directionary.&lt;BR /&gt;
ls -l  for UNIX, dir for WIN.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ksharp</description>
      <pubDate>Mon, 06 Dec 2010 04:04:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/last-modified-date-of-the-imported-file/m-p/44109#M9027</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2010-12-06T04:04:32Z</dc:date>
    </item>
    <item>
      <title>Re: last modified date of the imported file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/last-modified-date-of-the-imported-file/m-p/44110#M9028</link>
      <description>Thanks a tone folks..I did it with FINFO...But the last modified date was coming in an un usual format&lt;BR /&gt;
 eg:for 03Dec2010 1:36PM it was showing &lt;BR /&gt;
3 Dec Fri 13:36:00 2010&lt;BR /&gt;
&lt;BR /&gt;
Any suggestions to convert it into a date so that I can do some logical operations..</description>
      <pubDate>Mon, 06 Dec 2010 18:37:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/last-modified-date-of-the-imported-file/m-p/44110#M9028</guid>
      <dc:creator>syam_india_kochi</dc:creator>
      <dc:date>2010-12-06T18:37:29Z</dc:date>
    </item>
    <item>
      <title>Re: last modified date of the imported file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/last-modified-date-of-the-imported-file/m-p/44111#M9029</link>
      <description>try anydtdtm informat&lt;BR /&gt;
Otherwise you have to recombine it into a style easier for the datetime.  informat</description>
      <pubDate>Mon, 06 Dec 2010 19:34:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/last-modified-date-of-the-imported-file/m-p/44111#M9029</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2010-12-06T19:34:56Z</dc:date>
    </item>
    <item>
      <title>Re: last modified date of the imported file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/last-modified-date-of-the-imported-file/m-p/44112#M9030</link>
      <description>Hi.&lt;BR /&gt;
I think FILENAME + PIPE is just more simple.&lt;BR /&gt;
It can easily get the modifed date of file.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
filename date pipe 'dir c:\temp\  /a';&lt;BR /&gt;
data temp(keep=date time file_name);&lt;BR /&gt;
 infile date length=len;&lt;BR /&gt;
 input whole $varying200. len;&lt;BR /&gt;
 date=scan(whole,1,' ');&lt;BR /&gt;
 time=scan(whole,2,' ');&lt;BR /&gt;
 size=scan(whole,3,' ');&lt;BR /&gt;
 file_name=scan(whole,4,' ');&lt;BR /&gt;
 if findc(file_name,'.') and file_name not in ('.' '..') then output;&lt;BR /&gt;
run;&lt;BR /&gt;
proc print;run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ksharp</description>
      <pubDate>Tue, 07 Dec 2010 02:51:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/last-modified-date-of-the-imported-file/m-p/44112#M9030</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2010-12-07T02:51:11Z</dc:date>
    </item>
  </channel>
</rss>

