Previous Page | Next Page

SAS Component Language Dictionary

DOPTNAME



Returns the name of a directory attribute
Category: Directory

Syntax
Details
Example
See Also

Syntax

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


Details

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.


Example

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);


See Also

DINFO

DOPTNUM

Previous Page | Next Page | Top of Page