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:

Formatted:

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

Unformatted:

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

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

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

advance
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'.

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

iostat
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.

io-list
Is an I/O list.

form
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=*.)

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

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

For More Information:


Previous Page Next Page Table of Contents