FORTRAN Reference Manual
Statements
FORTRAN Reference Manual—528615-001
7-75
OPEN Statement
•
ACCESS specifier
The default setting is 'SEQUENTIAL'.
If you open a file with ACCESS = 'SEQUENTIAL' specified or assumed:
°
An INQUIRE statement’s ACCESS specifier returns 'SEQUENTIAL'.
°
For an EDIT format file, an ENDFILE statement or a non-update WRITE
statement deletes all records following the current position.
°
For a structured (relative, entry-sequenced, or key-sequenced) disk file, READ
statements use sequential block buffering if the OPEN statement also specifies
°
MODE = 'INPUT' and PROTECT = 'PROTECTED' or 'EXCLUSIVE' for the file.
°
You can still use direct or keyed access on the file, if the file type permits
these.
If you specify ACCESS = 'DIRECT' when you open a file:
°
The OPEN statement does not detect an error if the file is not capable of direct
access. An error is detected only when you try to read or write the file with
direct or keyed access.
°
An INQUIRE statement’s ACCESS specifier returns 'DIRECT'.
°
An ENDFILE statement has no effect for the file.
°
READ statements do not use sequential block buffering.
°
You can still access the file sequentially.
•
RECL specifier
The RECL specifier establishes the number of bytes per record in the file that you
are opening. FORTRAN determines the number of bytes per record as follows:
°
FORTRAN uses rcl if you specify it in the OPEN statement.
°
If you do not specify rcl and the file is a structured disk file, FORTRAN uses
the maximum length specified when the file was created.
°
If the file is not a structured disk file, FORTRAN uses the value you specify for
the REC parameter in a TACL ASSIGN command.
°
If you do not specify the record length in a TACL ASSIGN command,
FORTRAN uses the value you specify for the REC parameter in a UNIT
compiler directive for the specified unit.
°
If the file is not a disk file, FORTRAN uses the configured record length for the
device you are accessing.
°
If none of the preceding items apply, FORTRAN uses 132 bytes as the default
for RECL.
•
BLANK specifier










