XL Fortran for AIX 8.1

Language Reference



The REWIND statement positions an external file connected for sequential access at the beginning of the first record of the file.



is an external unit identifier. The value of u must not be an asterisk or a Hollerith constant.

is a list that must contain one unit specifier ([UNIT=]u) and can also contain one of each of the other valid specifiers. The valid specifiers are:

[UNIT=] u
is a unit specifier in which u must be an external unit identifier whose value is not an asterisk. An external unit identifier refers to an external file that is represented by a scalar integer expression, whose value is in the range 1 through 2,147,483,647. If the optional characters UNIT= are omitted, u must be the first item in position_list.

is an input/output status specifier that specifies the status of the input/output operation. ios is a scalar variable of type INTEGER(4) or default integer. When the REWIND statement finishes executing, ios is defined with:

ERR= stmt_label
is an error specifier that specifies the statement label of an executable statement in the same scoping unit to which control is to transfer in the case of an error. Coding the ERR= specifier suppresses error messages.


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.

+-------------------------------IBM Extension--------------------------------+

If IOSTAT= and ERR= are not specified,

+----------------------------End of IBM Extension----------------------------+



Related Information

[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]