DATA Step, Macro, Functions and more

File creation date

Reply
Occasional Contributor
Posts: 7

File creation date

Hello,

I am using sassuport code and I am expecting to get information about external file creation date. Unfortunately it returns other information about file.

sassupor code:

data info;

  length infoname infoval $60;

  drop rc fid infonum i close;

  rc=filename("abc","/data6/tmp.csv");

  fid=fopen("abc");

  infonum=foptnum(fid);

   do i=1 to 10;

     infoname=foptname(fid,i);

     infoval=finfo(fid,infoname);

     output;

   end;

  close=fclose(fid);

run;

I know It works fine on SAS 9.2, but I realy need any solution on 9.1.3. There are any other way to get file creation date and time?

PROC Star
Posts: 7,366

Re: File creation date

Super User
Posts: 10,550

Re: File creation date

You may want

do i =1 to infonum;

in case the element you want doesn't appear in the first 10 items reported by the OS.

PROC Star
Posts: 7,366

Re: File creation date

The issue isn't the value of infonum but, rather, the limited amount of information provided by SAS pre 9.2.  The page I pointed to shows how to obtain the desired information using a pipe.

Respected Advisor
Posts: 3,777

Re: File creation date

According to what I understand Creation time is not stored on UNIX system.

Ask a Question
Discussion stats
  • 4 replies
  • 1068 views
  • 3 likes
  • 4 in conversation