DOPTNAME Function


DOPTNAME Function

Returns directory attribute information

Category: External Files

See: DOPTNAME Function in the documentation for your operating environment.

Syntax

DOPTNAME ( directory-id , nval )

Arguments

directory-id

  • specifies the identifier that was assigned when the directory was opened, generally by the DOPEN function.

  • Restriction: The directory must have been previously opened by using DOPEN.

nval

  • specifies the sequence number of the option.

Details

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.

Examples

Example 1: Using DOPTNAME to Retrieve Directory Attribute Information

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

Example 2: Using DOPTNAME within a DATA Step

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; 

See Also

Functions:

  • 'DINFO Function' on page 501

  • 'DOPEN Function' on page 503

  • 'DOPTNUM Function' on page 506




SAS 9.1 Language Reference Dictionary, Volumes 1, 2 and 3
SAS 9.1 Language Reference Dictionary, Volumes 1, 2 and 3
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 704

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net