DOPEN opens a directory
and returns a directory identifier value (a number greater than 0)
that is used to identify the open directory in other SAS external
file access functions. If the directory could not be opened, DOPEN
returns 0, and you can obtain the error message by calling the SYSMSG
function. The directory to be opened must be identified by a fileref.
You can assign filerefs using the FILENAME statement or the FILENAME
external file access function. Under some operating environments,
you can also assign filerefs using system commands.
If you call the DOPEN
function from a macro, then the result of the call is valid only when
the result is passed to functions in a macro. If you call the DOPEN
function from the DATA step, then the result is valid only when the
result is passed to functions in the same DATA step.
Operating Environment Information: The term
directory that is
used in the description of this function and related SAS external
file access functions refers to an aggregate grouping of files managed
by the operating environment. Different operating environments identify
such groupings with different names, such as directory, subdirectory,
folder, MACLIB, or partitioned data set. For details, see the SAS
documentation for your operating environment.