FORTRAN Reference Manual
Introduction to File I/O in the HP NonStop
Environment
FORTRAN Reference Manual—528615-001
5-3
FORTRAN Files
FORTRAN Files
A file is a sequence of records. When a program executes, those files that are
available to it are said to exist for that program.
A file that exists for a program might not contain any records, as would be the case
with a newly created file. A file can be known to the Guardian file system but, for
security reasons, might not be visible to a program. The INQUIRE, OPEN, CLOSE,
WRITE, and PRINT statements can refer to files that do not exist.
External and Internal Files
A FORTRAN file is either external or internal.
An external file is a collection of records stored on a medium external to primary
memory. An internal file is a means of transferring data from one location to another
within memory.
The attributes of external files are determined by the device that handles their data
transfer, the file structure, and the method you use to access the file. The subsection
File Characteristics on page 5-16 describes the file structure of HP external files.
An internal file is a character variable, character array, character array element,
RECORD name, or character substring. It has the following attributes:
•
FORTRAN treats a file that is a character variable, character array element,
substring, undimensioned RECORD, or a RECORD array element as a single
record. The length of the record equals the length of the variable, array element,
substring, undimensioned RECORD, or RECORD array element. FORTRAN treats
RECORDs like character variables and arrays.
Table 5-2. File Attributes
Attribute Definition
Name Every file has a name that is defined either by the user when the file is
created or by the system when the file is opened. for additional
information, see HP File Names
on page 5-5.
Position A file connected to a unit has a position attribute. The execution of a
WRITE, READ, PRINT, BACKSPACE, REWIND, ENDFILE, OPEN, or
POSITION statement affects the file’s position.
Initial Point The initial point of a file is the position just before the first record.
Terminal Point The terminal point of a file is the position just after the last record.
Current Record The current record is the record where the file is currently positioned.
Preceding Record If the current record is n, the preceding record is the n-1 record.
Next Record If the current record is n, the next record is the n+1 record.










