The REWIND statement positions an external file connected
for sequential access at the beginning of the first record of the file.
For stream access, the REWIND statement positions
a file at its initial point.
If the unit is not connected, an implicit OPEN specifying sequential access is performed to a default file named fort.n, where n is the value of u with leading zeros removed. If the external file connected to the specified unit does not exist, the REWIND statement has no effect. If it exists, an end-of-file marker is created, if necessary, and the file is positioned at the beginning of the first record. If the file is already positioned at its initial point, the REWIND statement has no effect. The REWIND statement causes a subsequent READ or WRITE statement referring to u to read data from or write data to the first record of the external file associated with u.
If the ERR= and IOSTAT= specifiers are set and an error is encountered, transfer is made to the statement specified by the ERR= specifier and a positive integer value is assigned to ios.
If IOSTAT= and ERR= are not specified,
REWIND (9, IOSTAT=IOSS)