LINES (Lines Remaining)
returns the number of completed lines remaining in the character input stream name. If the stream has already been read with the CHARIN function, this can include an initial partial line. For persistent streams the count starts at the current read position. (To understand the input and output functions, see Input and Output Streams.)
The form of name is also described in Input and Output Streams. If you omit name or it is null, then the default input stream is tested.
Here are some examples:
LINES(myfile) -> 7 /* 7 lines remain */
LINES(myfile) -> 0 /* at end of the file */
LINES() -> 1 /* data remains in the */
/* default input stream */