End-of-Stream Treatment
For transient and persistent input streams use the CHARS function or the LINES function to detect the end of an input stream. These functions return 0 if no more characters or lines are available for reading, or they return 1 if at least one character or line is available for reading.
For transient streams, 0 means that the user has terminated
the input to the stream by means of the two-character sequence /*,
followed by the Enter key.
For persistent streams, 0 means that the input stream is either empty, or a previous read operation has already read the last character or line, or repeated read operations have triggered an end-of-file condition.
An attempt to read beyond the end of a stream returns a null string and triggers an error message. If this happens, the stream should be closed and reopened. Do not try to manipulate the position pointer after the end-of-file condition was triggered.