Returns the name of an item of information about a file.
Category: | External Files |
See: | FOPTNAME Function: Windows in SAS Companion for Windows |
FOPTNAME Function: UNIX in SAS Companion for UNIX Environments | |
FOPTNAME Function: z/OS in SAS Companion for z/OS |
%let filrf=myfile;
%let rc=%sysfunc(filename(filrf,
physical-filename));
%let fid=%sysfunc(fopen(&filrf));
%let infonum=%sysfunc(foptnum(&fid));
%do j=1 %to &infonum;
%let name=%sysfunc(foptname(&fid,&j));
%let value=%sysfunc(finfo(&fid,&name));
%put File attribute &name equals &value;
%end;
%let rc=%sysfunc(fclose(&fid));
%let rc=%sysfunc(filename(filrf));
data fileatt;
length name $ 20 value $ 40;
drop rc fid j infonum;
rc=filename("myfile","physical-filename");
fid=fopen("myfile");
infonum=foptnum(fid);
do j=1 to infonum;
name=foptname(fid,j);
value=finfo(fid,name);
put 'File attribute ' name
'has a value of ' value;
output;
end;
rc=filename("myfile");
run;