FORTRAN Reference Manual
Statements
FORTRAN Reference Manual—528615-001
7-65
INQUIRE Statement
inq-spec
is a keyword followed by an equal sign followed by a variable or array element in 
which FORTRAN returns the information specified by the keyword. You can specify 
inq-specs in any order. inq-spec is one of the following:
IOSTAT = ios
ios is an integer variable or integer array element in which FORTRAN returns 
an error number if an error occurs while executing the INQUIRE statement. If 
the INQUIRE statement 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 
INQUIRE statement.
EXIST = ext
ext is a logical variable or array element. For an inquiry of a Guardian file, if 
the specified file exists, ext returns a value of .TRUE.. If no such file exists, ext 
returns a value of .FALSE.. For an inquiry of a unit, if the specified unit exists, 
ext returns a value of .TRUE.. If the unit does not exist, ext returns .FALSE..
OPENED = open
open is a logical variable or array element. For an inquiry of a Guardian file, if 
the specified file is connected to a unit, open returns a value of .TRUE.; if the 
file is not connected, open returns a value of .FALSE.. For an inquiry by unit, if 
the specified unit is connected to a file, open returns a value of .TRUE.; if the 
unit is not connected to a file, open returns a value of .FALSE..
NUMBER = n
n is an integer variable or array element. If file-name or the file referenced 
by unit, whichever you specify, is open, FORTRAN returns the smallest unit 
number of all open units to the file. If the referenced file is not open, FORTRAN 
returns the smallest unit number of all units connected to the file.
NAMED = named
named is a logical variable or array element. named returns a value of .TRUE. 
if the file has a user-specified name. If the file has a system-assigned, 
temporary name, named returns a value of .FALSE..
NAME = fname
fname is a character variable or array element. fname is the file’s user-
specified or temporary name. If the specified unit is not connected, fname 
returns all blanks. See Considerations on page 7-67










