<?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: FINFO Function (How to get ANy file created Date and Time) in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/FINFO-Function-How-to-get-ANy-file-created-Date-and-Time/m-p/615574#M180059</link>
    <description>&lt;P&gt;Your displayed Access Permissions look a lot like UNIX. UNIX does not have a timestamp for "Create Time".&lt;/P&gt;</description>
    <pubDate>Tue, 07 Jan 2020 07:18:42 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2020-01-07T07:18:42Z</dc:date>
    <item>
      <title>FINFO Function (How to get ANy file created Date and Time)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FINFO-Function-How-to-get-ANy-file-created-Date-and-Time/m-p/615565#M180057</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am currently using SAS 9.4 and SAS Studio. My question would be on FINFO Function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to get properties of a SAS file using FINFO function. I am able to get Bytes and Last Modified date of a SAS file however i am unable to get Date and Time of the SAS file created for the first time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you let me know is there any other way or any function that we have in SAS to get a file created date and time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is my code and using the same code i am trying to get SAS file created Date and Time.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/** Macro technique **/                                                                                                                 
%macro FileAttribs(filename);                                                                                                           
   %local rc fid fidc;                                                                                                                   
   %local Bytes CreateDT ModifyDT;                                                                                                       
   %let rc=%sysfunc(filename(onefile,&amp;amp;filename));                                                                                       
   %let fid=%sysfunc(fopen(&amp;amp;onefile));                                                                                                  
   %let Bytes=%sysfunc(finfo(&amp;amp;fid,File Size (bytes)));                                                                                  
   %let CreateDT=%qsysfunc(finfo(&amp;amp;fid,Create Time));                                                                                     
   %let ModifyDT=%qsysfunc(finfo(&amp;amp;fid,Last Modified));                                                                                   
   %let fidc=%sysfunc(fclose(&amp;amp;fid));                                                                                                    
   %let rc=%sysfunc(filename(onefile));                                                                                                 
   %put NOTE: File size of &amp;amp;filename is &amp;amp;Bytes bytes;                                                                                  
   %put NOTE- Created &amp;amp;CreateDT;                                                                                                       
   %put NOTE- Last modified &amp;amp;ModifyDT;                                                                                                 
%mend FileAttribs;                                                                                                                      
                                                                                                                                        
/** Just pass in the path and file name **/                                                                                             
%FileAttribs(c:\aaa.txt)                                                                                                                
                                                                                                                                        
                                                                                                                                        
/** Non-macro technique **/                                                                                                             
filename fileref 'c:\aaa.txt';                                                                                                          
data a(drop=fid);                                                                                                                       
   infile fileref truncover obs=1;                                                                                                       
   fid=fopen('fileref');                                                                                                                 
   Bytes=finfo(fid,'File Size (bytes)');                                                                                                 
   crdate=finfo(fid,'Create Time');                                                                                                      
   moddate=finfo(fid,'Last Modified');                                                                                                   
run;                                                                                                                                    
                                                                                                                                        
proc print;                                                                                                                             
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture1.JPG" style="width: 301px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/35193iCBEECB82AE8A64D4/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture1.JPG" alt="Capture1.JPG" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.JPG" style="width: 261px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/35194i506E47E042EA44F0/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Hari&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jan 2020 06:55:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FINFO-Function-How-to-get-ANy-file-created-Date-and-Time/m-p/615565#M180057</guid>
      <dc:creator>Hari6</dc:creator>
      <dc:date>2020-01-07T06:55:32Z</dc:date>
    </item>
    <item>
      <title>Re: FINFO Function (How to get ANy file created Date and Time)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FINFO-Function-How-to-get-ANy-file-created-Date-and-Time/m-p/615574#M180059</link>
      <description>&lt;P&gt;Your displayed Access Permissions look a lot like UNIX. UNIX does not have a timestamp for "Create Time".&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jan 2020 07:18:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FINFO-Function-How-to-get-ANy-file-created-Date-and-Time/m-p/615574#M180059</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-01-07T07:18:42Z</dc:date>
    </item>
    <item>
      <title>Re: FINFO Function (How to get ANy file created Date and Time)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FINFO-Function-How-to-get-ANy-file-created-Date-and-Time/m-p/615581#M180061</link>
      <description>&lt;P&gt;There is an example program in the documentation of finfo, showing the names of all options:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
   length opt $100 optval $100;
   /* Allocate file  */
   rc=FILENAME('myfile', "C:\aaa.txt");
   /* Open file */
   fid=FOPEN('myfile');
   /* Get number of information
      items */
   infocnt=FOPTNUM(fid);
   /* Retrieve information items
      and print to log */
   put @1 "Information for a &amp;amp;SysScp. System Services File:";
   do j=1 to infocnt;
      opt=FOPTNAME(fid,j);
      optval=FINFO(fid,upcase(opt));
      put @1 opt @20 optval;
   end;
   /* Close the file */
   rc=FCLOSE(fid);
   /* Deallocate the file */
   rc=FILENAME('myfile');
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 07 Jan 2020 07:32:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FINFO-Function-How-to-get-ANy-file-created-Date-and-Time/m-p/615581#M180061</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2020-01-07T07:32:39Z</dc:date>
    </item>
    <item>
      <title>Re: FINFO Function (How to get ANy file created Date and Time)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FINFO-Function-How-to-get-ANy-file-created-Date-and-Time/m-p/615586#M180062</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;Thank you so much for your response.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jan 2020 08:03:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FINFO-Function-How-to-get-ANy-file-created-Date-and-Time/m-p/615586#M180062</guid>
      <dc:creator>Hari6</dc:creator>
      <dc:date>2020-01-07T08:03:11Z</dc:date>
    </item>
    <item>
      <title>Re: FINFO Function (How to get ANy file created Date and Time)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FINFO-Function-How-to-get-ANy-file-created-Date-and-Time/m-p/748845#M235239</link>
      <description>If UNIX doesnt support then is there any other way to get create date info?</description>
      <pubDate>Fri, 18 Jun 2021 08:52:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FINFO-Function-How-to-get-ANy-file-created-Date-and-Time/m-p/748845#M235239</guid>
      <dc:creator>pdhokriya</dc:creator>
      <dc:date>2021-06-18T08:52:05Z</dc:date>
    </item>
    <item>
      <title>Re: FINFO Function (How to get ANy file created Date and Time)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FINFO-Function-How-to-get-ANy-file-created-Date-and-Time/m-p/748898#M235266</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/55374"&gt;@pdhokriya&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;If UNIX doesnt support then is there any other way to get create date info?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Only for files where the respective application keeps such a timestamp within the file (or a metadata repository).&lt;/P&gt;
&lt;P&gt;For instance, SAS provides CRDATE in DICTIONARY.TABLES.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Jun 2021 14:16:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FINFO-Function-How-to-get-ANy-file-created-Date-and-Time/m-p/748898#M235266</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-06-18T14:16:31Z</dc:date>
    </item>
  </channel>
</rss>

