BookmarkSubscribeRSS Feed
sdemirel
Calcite | Level 5

Hi everyone,

 

I want to get the last modified date of a located file with FINFO function. I am using following code part for this but I am not getting any value and "modifydt" returns null. Could you please give a feedback on how I should fix this? thanks in advance.

 

SAS Enterprise Guide Version: 7.15 

Program:

data info (keep=modifydt);
rc = filename("onefile","C:\Users\sdmrl\Desktop\test.xls");
fid = fopen("onefile");
modifydt = FINFO(fid,"Last Modified");
run;
3 REPLIES 3
ballardw
Super User

@sdemirel wrote:

Hi everyone,

 

I want to get the last modified date of a located file with FINFO function. I am using following code part for this but I am not getting any value and "modifydt" returns null. Could you please give a feedback on how I should fix this? thanks in advance.

 

SAS Enterprise Guide Version: 7.15 

Program:

data info (keep=modifydt);
rc = filename("onefile","C:\Users\sdmrl\Desktop\test.xls");
fid = fopen("onefile");
modifydt = FINFO(fid,"Last Modified");
run;

If your value for RC is anything other than 0 the filename statement failed to assign a fileref.

If your value for FID is 0 it failed to open the file.

In either of the above fail then pretty much expect FINFO to fail.

sdemirel
Calcite | Level 5

Hi @ballardw ,

 

I checked the values for both and it seems to RC and FID is zero ('0'). In this case, it failed to open the file

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 546 views
  • 0 likes
  • 3 in conversation