DINFO Function


DINFO Function

Returns information about a directory

Category: External Files

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

Syntax

DINFO ( directory-id , info -item )

Arguments

directory-id

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

info-item

  • 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. This is a character value.

Details

Use DOPTNAME to determine the names of the available system-dependent directory information items. Use DOPTNUM to determine the number of directory information items available.

Operating Environment Information: DINFO returns the value of a system-dependent directory parameter. See the SAS documentation for your operating environment for information about system-dependent directory parameters.

Examples

Example 1: Using DINFO to Return Information about a Directory

This example opens the directory MYDIR, determines the number of directory information items available, and retrieves the value of the last one:

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

Example 2: Using DINFO within a DATA Step

This example creates a data set that contains the name and value of each directory information item:

 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; 

See Also

Functions:

  • 'DOPEN Function' on page 503

  • 'DOPTNAME Function' on page 505

  • 'DOPTNUM Function' on page 506

  • 'FINFO Function' on page 539

  • 'FOPTNAME Function' on page 552

  • 'FOPTNUM Function' on page 553




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