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

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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
  • 1138 views
  • 0 likes
  • 3 in conversation