FRLEN Function


FRLEN Function

Returns the size of the last record read, or, if the file is opened for output, returns the current record size

Category: External Files

Syntax

FRLEN ( file-id )

Argument

file-id

  • specifies the identifier that was assigned when the file was opened, generally by the FOPEN function.

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:

  • 'FCLOSE Function' on page 519

  • 'FOPEN Function' on page 550

  • 'FREAD Function' on page 558

  • 'MOPEN Function' on page 656




SAS 9.1 Language Reference Dictionary, Volumes 1, 2 and 3
SAS 9.1 Language Reference Dictionary, Volumes 1, 2 and 3
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 704

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net