FORTRAN Reference Manual

Statements
FORTRAN Reference Manual528615-001
7-18
CLOSE Statement
For further information, see Section 16, Fault-Tolerant Programming.
Examples
CHECKPOINT
CHECKPOINT (ERR=200, BACKUPSTATUS=ierr) accountno
CHECKPOINT (6, STACK='YES') msgnum, replycode
CLOSE Statement
The CLOSE statement disconnects a file from a specified unit and specifies the status
of the file after disconnection.
close-spec
is one of the following:
[UNIT=] unit
unit is an integer expression from 1 through 999 that identifies an external
unit connected for sequential access. If you omit the UNIT keyword, you must
write this specifier as the first item on the list.
IOSTAT = ios
is an integer variable or integer array element in which FORTRAN returns an
error number if an error occurred while executing the CLOSE statement. If the
CLOSE operation is successful, ios is zero. For more information about error
numbers, see the Error Numbers on page 6-5.
ERR = label
label is the label of an executable statement in the current program unit to
which FORTRAN transfers control if an error occurs while executing the
CLOSE statement.
STATUS = statstat
is a character expression with a value of either 'KEEP' or 'DELETE' and which
determines whether the file is to be kept or deleted after disconnection. For
additional details, see Considerations on page 7-19.
STACK = stack
stack is a character expression whose value is either 'YES' or 'NO'. The
default value is 'YES'. For additional details, see Considerations on page 7-19.
CLOSE ( close-spec [, close-spec ]... )