SAS Component Language Dictionary |
Returns the name of a directory attribute
attribute=DOPTNAME(directory-id,attribute-number);
|
-
attribute
-
contains the directory option. If nval is out-of-range, the program halts and attribute contains the value
that it held before the program
halt.
Type: Character
-
directory-id
-
contains the identifier that was assigned
when the directory was opened. If directory-id
is invalid, the program halts.
Type: Numeric
-
attribute-number
-
is the sequence number of the option.
Type: Numeric
DOPTNAME works only if the directory was previously
opened by the DOPEN function. The names and nature of directory information
items vary depending on the operating system. The number of attributes that
are available for a directory also varies depending on the operating system.
Open the directory identified by the fileref MYDIR,
retrieve all system-dependent directory information items, write them to the
SAS log, and then close the directory:
/* Assign the fileref MYDIR to the */
/* filename stored in the variable DIRNAME */
/* and open it. */
rc=filename('mydir',dirname);
dirid=dopen('mydir');
numitems=doptnum(dirid);
do j=1 to numitems;
opt=doptname(dirid,j);
put 'Directory information=' opt;
end;
rc=dclose(dirid);
DINFO
DOPTNUM
Copyright © 2011 by SAS Institute Inc., Cary, NC, USA. All rights reserved.