FORTRAN Reference Manual
Introduction to File I/O in the HP NonStop
Environment
FORTRAN Reference Manual—528615-001
5-14
Specifying File Attributes
If you use more than one method to specify the same file attribute, the compiler uses
the following order of precedence to determine the attribute value:
OPEN statement <-- highest
ASSIGN TACL command
UNIT compiler directive
Default <-- lowest
That is, an attribute value specified in an OPEN statement overrides a different value
specified for the same attribute of that unit in an ASSIGN command, and so forth.
Table 5-5 shows the different ways that you can specify file attributes. Note that you
cannot specify the file type, file code, extent sizes, or block size in an OPEN statement,
and that you can specify structured disk file types (relative, entry-sequenced, and
keysequenced) only by creating the file outside of FORTRAN, for example by using the
CREATE command in the FUP utility program.
If an executing FORTRAN program opens a file that already exists (that is, the file has
been created, though it might be empty), any attributes specified for the file in UNIT
directives, ASSIGN commands, or the OPEN statement, must agree with those of the
actual file.
If the file does not already exist, FORTRAN creates the file with the attributes you
specify.
Table 5-5. File Attribute Specification (page1of2)
Attribute Default Unit Directive
Assign
Command Open Statement
File name temporary file name file name FILE = cexp
File type Unstructured ---- ---- ----
File code 0 CODE num CODE num ----
Extent Size 1 page EXT (pri, sec)EXT (pri, sec) ----
Record size 132 REC num REC num RECL = exp
Access mode I-O access access MODE = cexp
Exclusion SHARED exclusion exclusion PROTECT = cexp
Unit name FTuuu UNITNAME
name
logical unit ----
temporary is a unique file name created by the system.
file name is an HP file name. If it is not fully qualified, run-time defaults are supplied for the missing
parts of the file name. In the OPEN statement, cexp is a character expression whose value
is in the file name.










