I think your logic is:
SAS program exists
Run program
If text input file last modified date is different than the last time this program ran
Go manipulate stuff
if not
Just quit and maybe provide a feedback message
I think that logic depends on two things, the first being what you asked which is grabbing the file date and the second being storing that date someplace to be able to compare it the next time the program is run.
I think the first part is:
filename fileref 'path\aaa.txt'; data a(drop=fid); infile fileref truncover obs=1; fid=fopen('fileref'); moddate=finfo(fid,'Last Modified'); run; proc print; run;
This make a dataset in WORK that contains the modified date. It looks like 12Jan2017:10:25:14.
I think then if you wrote that dataset out to a text file to store that date, when you ran your program again you could grab the incoming date, compare to the written out date, and logically see where you wanted to go.
HTH.
... View more