FORTRAN Reference Manual

Statements
FORTRAN Reference Manual528615-001
7-92
READ Statement
READ or READLOCK procedure. For additional information about these
procedures, see the Guardian Procedure Calls Reference Manual.
LENGTH specifier
Use the LENGTH specifier to determine the actual length of variable-length
records. If the READ statement terminates, len returns the actual length, in bytes,
of the record most recently read.
Note that the amount of the input record actually read may depend on format
control; len returns the full length of the record, whether or not all the record is
actually returned to your program.
TIMEOUT specifier
to represents a number of hundredths of a second. If the READ operation has not
completed when this time has elapsed, statement execution terminates with file
management error 40.
You can use the TIMEOUT specifier to impose a time limit only if you specify
TIMED=.TRUE. when you open the file.
PROMPT and PROMPTLENGTH specifiers
These specifiers are relevant only if the file is a terminal or a process.
The first character of the prompt has the effect defined by the SPACECONTROL
specifier of the OPEN statement.
You do not need to include a PROMPTLENGTH specifier. If you omit plen, the
actual number of characters defined for msg is output.
Implied DO list
See Using Implied DO Lists on page 5-27.
Reading from unit 5
If you read a record from unit 5 and you have not already established a connection
for the unit, READ implicitly opens the unit using default parameters. If you specify
ENV COMMON and you read a record from unit 5, your FORTRAN routines share
access to standard input with routines written in other languages only if the access
mode for the unit is INPUT. However, the default access mode for unit 5 is I-O. If
you want to share access to the file connected to unit 5, you must set the unit’s
access mode to INPUT before you execute the READ statement. You can set the
access mode:
°
In a FORTRAN OPEN statement, as in
OPEN( 5, MODE = 'INPUT')
°
In a TACL ASSIGN command, as in
ASSIGN FT005, , INPUT