FORTRAN Reference Manual
Statements
FORTRAN Reference Manual—528615-001
7-68
INQUIRE Statement
name you specify in the FILE = file-name specifier for an inquiry by file. For 
example, after execution of the following:
file id = 'myfile'
INQUIRE (FILE=file id, NAME = title)
TITLE contains a fully qualified file name such as $MYVOL.MYSVOL.MYFILE (if 
the specified file exists), while the value of FILE ID is still MYFILE (either the full 
name or the short form is acceptable when specifying the file name in an OPEN or 
INQUIRE statement). If the file you specify is a temporary file, the name returned is 
the temporary file name (for example, $VOLUME.#1234). To hold the full file name 
without truncation, fname should have a declared length of at least 35 characters.
•
Error conditions
If an error occurs while FORTRAN processes the INQUIRE statement, all the 
inquiry specifier entities remain unchanged except ios.
If you specify label, and an error occurs during the INQUIRE statement, 
FORTRAN transfers control to the statement identified by label. If you also 
specified ios, you can determine the error that occurred by analyzing ios.
If you specify ios, but not label, and an error occurs during the INQUIRE 
statement, your program continues executing with the statement that follows the 
INQUIRE statement. You can analyze ios to determine the error that occurred, if 
any.
If you do not specify ios or label, and an error occurs, FORTRAN terminates 
your program and displays a run-time diagnostic message.
Examples
LOGICAL nee, up, am
CHARACTER whosit*34
INQUIRE(UNIT=3,EXIST=am,OPENED=up,NAMED=nee,NAME=whosit)
LOGICAL ready
INTEGER number, howlong
INQUIRE(FILE=infile,OPENED=ready,NUMBER=number,RECL=howlong)










