Chapter Contents |
Previous |
Next |
FRLEN |
Category: | External Files |
Syntax | |
Argument | |
Examples | |
See Also |
Syntax |
FRLEN(file-id) |
Examples |
This example opens the file that is identified by the fileref MYFILE. It determines the minimum and maximum length of records in the external file and writes the results to the log:
%let fid=%sysfunc(fopen(myfile)); %let min=0; %let max=0; %if (%sysfunc(fread(&fid)) = 0) %then %do; %let min=%sysfunc(frlen(&fid)); %let max=&min; %do %while(%sysfunc(fread(&fid)) = 0); %let reclen=%sysfunc(frlen(&fid)); %if (&reclen > &max) %then %let max=&reclen; %if (&reclen < &min) %then %let min=&reclen; %end; %end; %let rc=%sysfunc(fclose(&fid)); %put max=&max min=&min;
See Also |
Functions:
|
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.