Functions and CALL Routines |
Returns directory attribute information.
DOPTNAME(directory-id,nval)
|
-
directory-id
-
is a numeric variable that specifies the
identifier that was assigned when the directory was opened by the DOPEN function.
-
nval
-
is a numeric constant, variable, or expression
that specifies the sequence number of the option.
Operating Environment Information: The
number, names, and nature of the directory information varies between operating
environments. The number of options that are available for a directory varies
depending on the operating environment. For details, see the SAS documentation
for your operating environment. ![[cautionend]](../../../../common/63294/HTML/default/images/cautend.gif)
This example opens the directory with
the fileref MYDIR, retrieves all system-dependent directory information items,
writes them to the SAS log, and closes the directory:
%let filrf=mydir;
%let rc=%sysfunc(filename(filrf,physical-name));
%let did=%sysfunc(dopen(&filrf));
%let infocnt=%sysfunc(doptnum(&did));
%do j=1 %to &infocnt;
%let opt=%sysfunc(doptname(&did,&j));
%put Directory information=&opt;
%end;
%let rc=%sysfunc(dclose(&did));
This example creates a data set that contains the name and value of each directory
information item:
data diropts;
length optname $ 12 optval $ 40;
keep optname optval;
rc=filename("mydir","physical-name");
did=dopen("mydir");
numopts=doptnum(did);
do i=1 to numopts;
optname=doptname(did,i);
optval=dinfo(did,optname);
output;
end;
run;
Copyright © 2011 by SAS Institute Inc., Cary, NC, USA. All rights reserved.