Fortran 77 requires that internal files must be accessed sequentially. For files that also allow direct access, the order of files depends on the record number. If a file is written sequentially, the first record written is record number 1 for direct access, the second written is record number 2, and so on. Formatted and unformatted records cannot be mixed within a file. The last record of the file can be an endfile record.
Record numbers are positive integers that are attached when the record is written.
Records are ordered by their record numbers. Formatted and unformatted records cannot be mixed in a file. The file must not contain an endfile record if it is direct access only. If the file also allows sequential access, an endfile record is permitted but will be ignored while the file is connected for direct access. All records of the file have the same length.