Chapter Contents |
Previous |
Next |
DREAD |
Category: | External Files |
Syntax | |
Arguments | |
Details | |
Examples | |
See Also |
Syntax |
DREAD(directory-id,nval) |
Restriction: | The directory must have been previously opened by using DOPEN. |
Details |
DREAD returns a blank if an error occurs (such as when nval is out-of-range). Use DNUM to determine the highest possible member number that can be passed to DREAD.
Examples |
This example opens the directory identified by the fileref MYDIR, retrieves the number of members, and places the number in the variable MEMCOUNT. It then retrieves the name of the last member, places the name in the variable LSTNAME , and closes the directory:
%let filrf=mydir; %let rc=%sysfunc(filename(filrf,physical-name)); %let did=%sysfunc(dopen(&filrf)); %let lstname=; %let memcount=%sysfunc(dnum(&did)); %if &memcount > 0 %then %let lstname=%sysfunc(dread(&did,&memcount)); %let rc=%sysfunc(dclose(&did));
See Also |
Functions:
|
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.