Fortran · File status code

IOSTAT 26 — OPEN or DEFINE FILE Required

What does IOSTAT 26 — OPEN or DEFINE FILE Required mean in Fortran?

Raised when a direct-access READ or WRITE (using REC=) is attempted on a unit that was never opened with ACCESS='DIRECT' (or set up with the legacy DEFINE FILE statement). The runtime has no record layout to use for the direct-access request.

IOSTAT 26 — OPEN or DEFINE FILE RequiredIntel Fortran

Condition

Raised when a direct-access READ or WRITE (using REC=) is attempted on a unit that was never opened with ACCESS='DIRECT' (or set up with the legacy DEFINE FILE statement). The runtime has no record layout to use for the direct-access request.

Fix

Add an explicit OPEN with ACCESS='DIRECT' and an appropriate RECL before any direct-access I/O on that unit.

Pending source verification. Not yet checked against official documentation.

Related file status code