Use functions FOPEN
and FINFO
Example:
Show all available information items and their value for a sample data file.
filename datafile 'c:empdatafile.txt';
data _null_;
file datafile;
put 'Me data';
run;
data _null_;
fid = fopen('datafile');
if fid then do;
do index = 1 to foptnum(fid);
info_name = foptname(fid,index);
info_value = finfo(fid, info_name);
put index= info_name= @40 info_value=;
end;
rc = fclose(fid);
end;
run;
Will log information such as
index=1 info_name=Filename info_value=c:empdatafile.txt
index=2 info_name=RECFM info_value=V
index=3 info_name=LRECL info_value=32767
index=4 info_name=File Size (bytes) info_value=9
index=5 info_name=Last Modified info_value=26Jan2021:06:29:47
index=6 info_name=Create Time info_value=26Jan2021:06:28:23
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…