Previous Page | Next Page

SAS Component Language Dictionary

DCLOSE



Closes a directory
Category: Directory

Syntax
Details
Example
See Also

Syntax

sysrc=DCLOSE(directory-id);

sysrc

contains the return code for the operation:

0

successful

[ne]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


Details

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.


Example

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;


See Also

DOPEN

FCLOSE

FOPEN

MOPEN

Previous Page | Next Page | Top of Page