Chapter Contents |
Previous |
Next |
FREAD |
Category: | External File |
Syntax | |
Details | |
Example | |
See Also |
Syntax |
sysrc=FREAD(file-id); |
0 | successful |
0 | not successful |
Type: Numeric
Type: Numeric
Details |
The position of the file pointer is automatically updated after the read operation so that successive FREAD functions read successive file records.
Use FNOTE, FPOINT, and FREWIND to position the file pointer explicitly.
Example |
Assign the fileref MYFILE to an external file and attempt to open the file. Read each record from the file and list it in the LOG window.
/* Assign the fileref MYFILE to the physical */ /* filename stored in the variable FNAME */ /* and open it. */ rc=filename('myfile',fname); fileid=fopen('myfile'); if (fileid>0) then do while(fread(fileid)=0); rc=fget(fileid,c,200); put c; end; rc=fclose(fileid); rc=filename('myfile','');
See Also |
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.