FORTRAN-SO

Input/Output

The list of control information specifiers is:

[UNIT =] unit [FMT =] f REC = recno IOSTAT = stname ERR = stl

END = stl

U nit specifier Format specifier Record number specifier I/O status specifier Error specifier End-of-file specifier

6.3.1.1 Control Information List

The control information list must contain a unit specifier. If the second form of the READ statement shown above is used (that is, if no unit is specified), the unit read is the default unit.

The 'ctl-list' may contain, at most, one of each of the other specifiers.

The following sections 6.3.1.1.1 through 6.3.1.1.6 describe control list specifiers in detail.

6.3.1.1.1Unit Specifier. The unit specifier has the same interpretation as for the OPEN statement (section 6.2.1.1). In addition, for data-transfer I/O statements, 'unit' may be an asterisk. If this is the case, the specifier identifies a particular processor-determined external unit.

The unit specifier may also point to an internal file (that is, 'unit' may be the name of a character variable, character array, or character array element name). In this case, 'ctl-list' must contain a format identifier (other than asterisk) and may not contain a record number specifier.

If the optional 'UNIT ='is omitted, the unit specifier must be the first item in 'ctl- list.'

Example:

READ (2) PNAME, AB, HITS

6.3.1.1.2Format Specifier. If 'ctl-list' contains a format specifier, the READ state- ment is aformatted I/O statement; otherwise, it is an unformatted I/O statement.

The format of this specifier is

[FMT =]f

where 'f' is one of the following:

The label of a FORMAT statement in the same program unit as the READ;

An integer variable ASSIGNed the label of a FORMAT statement;

A character array name, character variable name, or character expression containing a format specification;

An asterisk (*) specifying list-directed formatting (section 6.4.4);

An integer, real, or logical array containing a format specification as Hollerith data.

If the optional 'FMT ='is omitted, the format specifier must be the second item in 'ctl-list' and the first item must be the unit specifier without the optional characters 'UNIT =.'

6-11

Page 71
Image 71
Intel fortran-80 manual Control Information List, Read 2 PNAME, AB, Hits, FMT =f