FORTRAN Reference Manual

Statements
FORTRAN Reference Manual528615-001
7-91
READ Statement
Considerations
Order of read specifiers
Entries for read-spec can be in any order, except that:
°
If you omit the UNIT keyword, unit must be the first item in the list.
°
If you omit the FMT keyword, format must be the second item in the list, unit
must be the first item in the list, and you must specify unit without the UNIT
keyword.
REC specifier
The control list must not contain a record specifier if any of the following are true:
°
The file is connected for sequential access
°
The unit specifier names an internal file
°
The format specifier is an asterisk
You cannot use a record specifier on an EDIT format file in a FORTRAN program
that is running as a NonStop process.
If the control list contains a record specifier, it must not contain an end-of-file
specifier.
IOSTAT specifier
See the Error conditions on page 7-93 and End-of-file condition on page 7-93.
ERR specifier
See the Error conditions on page 7-93.
END specifier
See the End-of-file condition
on page 7-93.
LOCK specifier
The default value is .FALSE.. The LOCK specifier is relevant only for structured
files.
The lock specifier coordinates access to a file shared by two or more processes. If
lock is .TRUE., the current record becomes temporarily unavailable to other
processes. Use a subsequent WRITE statement with lock set to .FALSE. to
restore record access to other processes sharing the file.
UPDATE specifier
The default value is .FALSE.. This specifier is relevant only for disk files (except
EDIT format files) and processes.
If the value of update is .TRUE., FORTRAN uses the READUPDATE or
READUPDATELOCK procedure; if the value is .FALSE., FORTRAN uses the