Fortran · File status code
What does IOSTAT 33 — ENDFILE Error mean in Fortran?
Raised when an ENDFILE statement is issued on a unit that isn't sequential, whose unformatted records aren't properly segmented, or whose access mode is otherwise incompatible with writing an end-of-file marker.
Raised when an ENDFILE statement is issued on a unit that isn't sequential, whose unformatted records aren't properly segmented, or whose access mode is otherwise incompatible with writing an end-of-file marker.
Only call ENDFILE on units opened for sequential access, and issue it immediately after the last WRITE rather than after repositioning with BACKSPACE into the middle of the file.