INQUIRE statement
Standard: F77 F90 F95 F2003 F2008
<Syntax>
INQUIRE ( IOLENGTH = variable ) output-list

INQUIRE ( inquire-spec [ , inquire-spec ]... )

The possible inquire-specs are listed in the table in the section below. In this form, either the FILE= or UNIT= specifier must appear, but not both. For the UNIT= specifier, the keyword and equals sign may be omitted if it is the first inquire-spec.
<Semantics>
The first form enquires as to the length needed to be specified for RECL= in the OPEN statement for an unformatted sequential file to be able to write records as large as the output-list.

The second form enquires the status of an external unit or external file. The effect of each clause is as below. All specifier arguments are scalar, and must be variables except for FILE=, ID= and UNIT=.

Specifier Argument Meaning Values
[ UNIT= ] Integer External unit number Non-negative
FILE= Character External file name
ACCESS= Character Current access mode 'DIRECT', 'SEQUENTIAL', 'STREAM', 'UNDEFINED'
ACTION= Character Currently allowed actions 'READ', 'READWRITE', 'UNDEFINED', 'WRITE'
ASYNCHRONOUS= Character Is async i/o allowed? 'YES', 'NO', 'UNDEFINED'
BLANK= Character Blanks are nulls or zeros? 'NULL', 'ZERO', 'UNDEFINED'
CONVERT= Character Conversion mode 'BIG_ENDIAN', 'BIG_IEEE', 'BIG_IEEE_DD', 'BIG_NATIVE', 'LITTLE_ENDIAN', 'LITTLE_IEEE', 'LITTLE_IEEE_DD', 'LITTLE_NATIVE', 'NATIVE', 'UNDEFINED'
DECIMAL= Character Decimal edit mode 'POINT', 'COMMA', 'UNDEFINED'
DELIM= Character Character delimiter mode 'APOSTROPHE', 'NONE', 'QUOTE', 'UNDEFINED'
DIRECT= Character Is direct access allowed? 'YES', 'NO', 'UNKNOWN'
ENCODING= Character File encoding method 'ASCII', 'EBCDIC', 'UTF-8', 'UNDEFINED', 'UNKNOWN'
ERR= Label Goto if error in INQUIRE
EXIST= Logical File or unit exists? .TRUE. , .FALSE.
FORM= Character Form of connection 'FORMATTED', 'UNFORMATTED', 'UNDEFINED'
FORMATTED= Character Formatted i/o allowed? 'YES', 'NO', 'UNKNOWN'
ID= Integer Pending data transfer identifier
IOMSG= Character Error message from INQUIRE
IOSTAT= Integer Status of the INQUIRE
NAME= Character Name of the file
NAMED= Logical Whether the file is named .TRUE., .FALSE.
NEXTREC= Integer Next record for direct access
NUMBER= Integer Unit number
OPENED= Logical Is there a connection? .TRUE., .FALSE.
PAD= Character Record padding mode 'YES', 'NO', 'UNDEFINED'
PENDING= Logical Async i/o still pending?
POS= Integer Next file storage unit
POSITION= Character Current file position 'ASIS', 'REWIND', 'APPEND', 'UNDEFINED'
READ= Character Is READ allowed? 'YES', 'NO', 'UNKNOWN'
READWRITE= Character Are both READ and WRITE allowed? 'YES' , 'NO', 'UNKNOWN'
RECL= Integer Record length of file
ROUND= Character I/O rounding mode 'COMPATIBLE', 'DOWN', 'NEAREST', 'PROCESSOR_DEFINED', 'UP', 'ZERO', 'UNDEFINED'
SEQUENTIAL= Character Is sequential access allowed? 'YES', 'NO', 'UNKNOWN'
SIGN= Character Sign edit mode 'PLUS', 'SUPPRESS', 'PROCESSOR_DEFINED', 'UNDEFINED'
STREAM= Character Is stream access allowed? 'YES', 'NO', 'UNKNOWN'
UNFORMATTED= Character Unformatted i/o allowed? 'YES', 'NO', 'UNKNOWN'
WRITE= Character Is WRITE allowed? 'YES', 'NO', 'UNKNOWN'
<Related>
ASYNCHRONOUS= specifier, CONVERT= specifier, DECIMAL= specifier, ENCODING= specifier, ERR= specifier, ID= specifier, IOMSG= specifier, IOSTAT= specifier, OPEN statement, PENDING= specifier, READ statement, ROUND= specifier, SIGN= specifier, UNIT= specifier, WRITE statement