Always enabled.
If the specified file is not closed after the condition is raised, this causes subsequent GET or READ statements to the file to be unsuccessful, and also raises additional ENDFILE conditions.
During an operation when an attempt is made to read past the end of the file specified in the GET or READ statement. The ENDFILE condition applies only to SEQUENTIAL INPUT, SEQUENTIAL UPDATE, and STREAM INPUT files.
ENDFILE is also raised during record-oriented data transmission when an end-of-file is encountered during the execution of a READ statement.
Finally, ENDFILE is raised in stream-oriented data transmission 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.
ENDFILE [file-reference]