Fortran · File status code

IOSTAT 33 — ENDFILE Error

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.

IOSTAT 33 — ENDFILE ErrorIntel Fortran

Condition

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.

Fix

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.

Pending source verification. Not yet checked against official documentation.

Related file status code