But the file must not be closed in its ENDFILE ON-unit: it should be closed only after that ON-unit has been exited.
In record-oriented data transmission, ENDFILE is raised whenever an end of file is encountered during the execution of a READ statement.
In stream-oriented data transmission, ENDFILE is raised during the execution of a GET statement if an end of file is encountered either before any items in the GET statement data list have been transmitted or between transmission of two of the data items. If an end of file is encountered while a data item is being processed, or if it is encountered while an X-format item is being processed, the ERROR condition is raised.
|
The file-reference must be a scalar reference.
If a file is closed in an ON-unit for this condition, the results of normal return are undefined. Exit from the ON-unit with the closed file must be achieved with a GO TO statement.