SAS Component Language Dictionary |
Closes a directory
sysrc=DCLOSE(directory-id);
|
-
sysrc
-
contains the return code for the operation:
0 |
successful |
0 |
not successful |
Type:
Numeric
-
directory-id
-
is the identifier that was assigned when
the directory was opened. If directory-id is
invalid, the program halts.
Type: Numeric
The DCLOSE function closes a directory that was previously
opened by the DOPEN function. DCLOSE also closes any open members of the directory
before closing the directory.
Open the directory to which the fileref MYDIR has previously
been assigned, return the number of members, and then close the directory:
rc=filename('mydir','fname')
did=dopen('mydir');
memcount=dnum(did);
if (dclose(did)) then
do;
_msg_=sysmsg();
...SCL statements to handle the error condition...
end;
DOPEN
FCLOSE
FOPEN
MOPEN
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.