HP Fortran Programmer's Reference (September 2007)

HP Fortran statements
ENDFILE
Chapter 10 347
ENDFILE
Writes end-of-file record to file.
Syntax
The syntax of the ENDFILE statement can take one of the following forms:
Short form:
ENDFILE
integer-expression
Long form:
ENDFILE (
io-specifier-list
)
integer-expression
is the number of the unit connected to a sequential file.
io-specifier-list
is a list of the following comma-separated I/O specifiers:
[UNIT=]
unit
specifies the unit connected to a device or external file opened for sequential
access.
unit
must be an integer expression that evaluates to a nonnegative
number. If the optional keyword UNIT= is omitted,
unit
must be the first
item in
io-specifier-list
.
ERR=
stmt-label
specifies the label of the executable statement to which control passes if an
error occurs during statement execution.
IOSTAT=
integer-variable
returns the I/O status after the statement executes. If the statement
executes successfully,
integer-variable
is set to zero. If an error occurs, it
is set to a positive integer that indicates which error occurred.
Description
The ENDFILE statement writes an end-of-file record to the file or device connected to the
specified unit at the current position and positions the file after the end-of-file record.