Hello,
I'm using SAS 9.4 for this code on a Windows computer. A .bat file runs this program each morning and my first lines of code use finfo to find the last modified date of two csv files I'm importing. The csv files gets overwritten each morning prior to the SAS program running, so if the last modified date is not equal to today's date, I force the program to abort.
The issue is that the program has aborted twice now (not consecutively - once a week ago and this morning) because finfo generated an incorrect last modified date. This morning it says the csv files were last updated on Oct. 11th, but they were actually updated this morning on Oct. 12th. What could be causing this? Code below from this morning's run.
NOTE: PROCEDURE PRINTTO used (Total process time):
real time 0.03 seconds
cpu time 0.00 seconds
The SAS System 06:00 Monday, October 12, 2020
Engine: V9
filename fileref "J:\Tests.csv";
filename filerefa "J:\Facilities.csv";
data a(drop=fidlab fidreg);
infile fileref truncover obs=1;
infile filerefa truncover obs=1;
fidlab=fopen("fileref");
fidreg=fopen("filerefa");
moddatelab=input(finfo(fidlab,"Last Modified"),anydtdte32.);
moddatereg=input(finfo(fidreg,"Last Modified"),anydtdte32.);
format moddatelab moddatereg date9.;
CALL SYMPUT("labtime",put(moddatelab,date9.)) ;
CALL SYMPUT("regtime",put(moddatereg,date9.)) ;
run;
NOTE: The infile FILEREF is:
Filename=J:\Tests.csv,
RECFM=V,LRECL=32767,File Size (bytes)=2407224,
Last Modified=11Oct2020:03:15:16,
Create Time=15Sep2020:11:40:50
NOTE: The infile FILEREFA is:
Filename=J:\Facilities.csv,
RECFM=V,LRECL=32767,File Size (bytes)=41733,
Last Modified=11Oct2020:03:17:01,
Create Time=15Sep2020:11:41:54
However, when I check the filepath to see when the two csv files were last updated, this is what I see.
EDIT: Worth noting that the two csv files get updated each morning at 12:17 AM and 12:15 AM MST. The program is run on an EST computer so the 11Oct2020:03:17 and 11Oct2020:03:15 times are from yesterday's update to to the CSV files. I'm not sure why SAS picked up that one instead of this morning's modification.
... View more