Chapter Contents |
Previous |
Next |
DREAD |
Category: | Directory |
Syntax | |
Details | |
Example | |
See Also |
Syntax |
name=DREAD(directory-id,member-num); |
Type: Character
Type: Numeric
Type: Numeric
Details |
Use DNUM to determine the highest possible member number that can be passed to DREAD. DREAD works only if the directory was previously opened by the DOPEN function.
Example |
Open the directory identified by the fileref MYDIR, retrieve the number of members and place the number in the variable MEMCOUNT, retrieve the name of the last member and place the name in the variable LSTNAME, and then close the directory:
/* Assign the fileref MYDIR to the */ /* filename stored in the variable DIRNAME */ /* and open it. */ rc=filename('mydir',dirname); dirid=dopen('mydir') lstname=''; memcount=dnum(dirid); if (memcount>0) then lstname=dread(dirid,memcount); rc=dclose(dirid);
See Also |
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.