I am afraid that TomKari is correct here. Your logic doesn't make sense as is. The date created and date modified will be the date time that this part of the code is run: filename filelist pipe 'dir "f\shares\jim\finance\*.mdb" /b'; data work.use_date; Now what I think you want is the date time of the file as it is from the operating system. I.e. if I create a file in Windows on the 13MAR2013, then I run your code on the 26JAN2014, the creation date would be 26JAN2014, whereas what you want to know is 13MAR2013. To do this you need to modify how you get the directory listing. Doing the below gets the directory listing, then post processes the info to get creation date time, size and filename. These can then be symputted into macro variables or otherwise processed. Note the /tc in the pipe, this means the date/time is the creation date/time. If you want accessed then /ta, for last written use /tw. filename mypipe pipe 'dir "s:\temp\rob" /tc'; data use_date; attrib buffer format=$2000. file_last_written_date format=date9. file_last_written_time format=time5. file_size format=best. file_name format=$200.; infile mypipe; input buffer $2000.; if substr(buffer,1,5) in ("Volum","Direc") or index(buffer,"<DIR>")>0 or index(buffer,"Dir(s)")>0 then delete; /* Remove some extra info */ file_last_written_date=input(put(scan(compbl(buffer),1,' '),$10.),ddmmyy10.); /* note dependant on system settings */ file_last_written_time=input(put(scan(compbl(buffer),2,' '),$5.),time5.); file_size=scan(compbl(buffer),3,' '); file_name=scan(compbl(buffer),4,' '); run;
... View more