Returns information about a directory.
Category: | External Files |
See: | DINFO Function: Windows in SAS Companion for Windows |
DINFO Function: UNIX in SAS Companion for UNIX Environments | |
DINFO Function: z/OS in SAS Companion for z/OS |
is a numeric variable that specifies the identifier that was assigned when the directory was opened by the DOPEN function.
is a character constant, variable, or expression that specifies the information item to be retrieved. DINFO returns a blank if the value of the info-item argument is invalid. The information available varies according to the operating environment.
%let filrf=MYDIR;
%let rc=%sysfunc(filename(filrf,physical-name));
%let did=%sysfunc(dopen(&filrf));
%let numopts=%sysfunc(doptnum(&did));
%let foption=%sysfunc(doptname(&did,&numopts));
%let charval=%sysfunc(dinfo(&did,&foption));
%let rc=%sysfunc(dclose(&did));
data diropts;
length foption $ 12 charval $ 40;
keep foption charval;
rc=filename("mydir","physical-name");
did=dopen("mydir");
numopts=doptnum(did);
do i=1 to numopts;
foption=doptname(did,i);
charval=dinfo(did,foption);
output;
end;
run;