![]() Chapter Contents |
![]() Previous |
![]() Next |
| FRLEN |
| Category: | External File |
| Syntax | |
| Example | |
| See Also |
Syntax |
| length=FRLEN(file-id); |
Type: Numeric
Type: Numeric
| Example |
Open the file identified by the fileref THEFILE. Determine the minimum and maximum lengths of records in the external file, and write the results to the LOG window.
/* Assign the fileref THEFILE to the physical */
/* filename stored in the variable FNAME */
/* and open it. */
rc=filename('thefile',fname);
fileid=fopen('thefile');
min=0;
max=0;
if (fread(fileid)=0) then do;
min=frlen(fileid);
max=min;
do while(fread(fileid)=0);
reclen=frlen(fileid);
if (reclen>max) then max=reclen;
if (reclen<min) then min=reclen;
end;
rc=fclose(fileid);
end;
put min= max=;
| See Also |
![]() Chapter Contents |
![]() Previous |
![]() Next |
![]() Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.