10.3.1 Forms for Sequential READ Statements

Sequential READ statements transfer input data from external sequential-access records. The statements can be formatted with format specifiers (which can use list-directed formatting) or namelist specifiers (for namelist formatting), or they can be unformatted.

Sequential READ statements take one of the following forms:


READ (eunit, format [, advance] [, size] [, iostat] [, err] [, end] [, eor]) [io-list]
READ form [, io-list]

Formatted - List-Directed:

READ (eunit, * [, iostat] [, err] [, end]) [io-list]
READ * [, io-list]

Formatted - Namelist:

READ (eunit, nml-group [, iostat] [, err] [, end])
READ nml


READ (eunit [, iostat] [, err] [, end]) [io-list]

Is an external unit specifier ([UNIT=]io-unit).

Is a format specifier ([FMT=]format).

Is an advance specifier (ADVANCE=c-expr). If the value of c-expr is 'YES', the statement uses advancing input; if the value is 'NO', the statement uses nonadvancing input. The default value is 'YES'.

Is a character count specifier (SIZE=i-var). It can only be specified for nonadvancing READ statements.

Is a status specifier (IOSTAT=i-var).

err, end, eor
Are branch specifiers if an error (ERR=label), end-of-file (END=label), or end-of-record (EOR=label) condition occurs.

EOR can only be specified for nonadvancing READ statements.

Is an I/O list.

Is the nonkeyword form of a format specifier (no FMT=).

Is the format specifier indicating list-directed formatting. (It can also be specified as FMT=*.)

Is a namelist specifier ([NML=]group) indicating namelist formatting.

Is the nonkeyword form of a namelist specifier (no NML=) indicating namelist formatting.

For More Information:

Previous Page Next Page Table of Contents