DINFO Function: Windows

Returns information about a directory.

Category: External Files
Windows specifics: directory pathname is the only information available
See: DINFO Function in SAS Functions and CALL Routines: Reference


Required Arguments


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


specifies the information item to be retrieved. DINFO returns a blank if the value of info-item is invalid.


Directories that are opened with the DOPEN function are identified by a directory–id. 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.
Under Windows, the only info-item that is available is Directory, which is the pathname of directory-id. If directory-id points to a list of concatenated directories, then Directory is the list of concatenated directory names.

Example: Obtaining Directory Information

data a;
  rc=filename("tmpdir", "c:");
  put "rc = 0 if the directory exists: " rc=;
  put did=;
  put numopts=;
  do i = 1 to numopts;
    optname = doptname(did,i);
    put i= optname=;
    put optval=;
The SAS Log Displays the Directory Information
NOTE: PROCEDURE PRINTTO used (Total process time):
      real time           0.03 seconds
      cpu time            0.00 seconds
446  data a;
447    rc=filename("tmpdir", "c:");
448    put "rc = 0 if the directory exists: " rc=;
449    did=dopen("tmpdir");
450    put did=;
451    numopts=doptnum(did);
452    put numopts=;
453    do i = 1 to numopts;
454      optname = doptname(did,i);
455      put i= optname=;
456      optval=dinfo(did,optname);
457      put optval=;
458    end;
459  run;
rc = 0 if the directory exists: rc=0
i=1 optname=Directory
NOTE: The data set WORK.A has 1 observations and 6 variables.
NOTE: DATA statement used (Total process time):
      real time           0.08 seconds
      cpu time            0.04 seconds
460  proc printto; run;