HP 3000 Manuals

INQUIRE Statement (Executable) [ HP FORTRAN 77/iX Reference ] MPE/iX 5.0 Documentation


HP FORTRAN 77/iX Reference

INQUIRE Statement (Executable) 

The INQUIRE statement provides information about selected properties of a
file or unit number.

[]
----------------------------------------------------------------------------------------------- | | | | | Item | Description/Default | Restrictions | | | | | ----------------------------------------------------------------------------------------------- | | | | | unit | Unit number of a sequential file. | Integer expression >= 0. | | | | | ----------------------------------------------------------------------------------------------- | | | | | name | Specifies file name for inquiry by | Character expression. | | | file name. | | | | | | ----------------------------------------------------------------------------------------------- | | | | | label | Control transfers to the specified | Must be the statement label of an | | | executable statement if an error | executable statement in the same | | | condition exists on the named file | program unit. | | | or unit. | | | | | | ----------------------------------------------------------------------------------------------- | | | | | ios | ios = zero if no error; ios = | Integer variable, array element, | | | positive value if error condition | or scalar record field. | | | exists. | | | | | | ----------------------------------------------------------------------------------------------- | | | | | ex | ex = true if named file exists; | LOGICAL*4 variable, array element, | | | ex = false otherwise. | or scalar record field. | | | | | ----------------------------------------------------------------------------------------------- | | | | | opnd | od = true if named file or unit | LOGICAL*4 variable, array element, | | | has been opened; od = false | or scalar record field. | | | otherwise. | | | | | | ----------------------------------------------------------------------------------------------- | | | | | num | FORTRAN logical unit number of the | INTEGER*4 variable, array element, | | | external named file; if no unit is | or scalar record field. | | | connected to the named file, num | | | | is undefined. | | | | | | ----------------------------------------------------------------------------------------------- | | | | | nmd | nmd = true if specified unit is | LOGICAL*4 variable, array element, | | | not a scratch file; nmd = false | or scalar record field. | | | otherwise. | | | | | | ----------------------------------------------------------------------------------------------- | | | | | fn | Returns predefined system file | Character variable, array element, | | | name or name used in OPEN | substring, or scalar record field. | | | statement. If the file has no | | | | name or is not connected, fn is | | | | undefined. | | | | | | ----------------------------------------------------------------------------------------------- | | | | | use | See "Semantics". | Character variable, array element, | | | | substring, or scalar record field. | | | | | ----------------------------------------------------------------------------------------------- | | | | | acc | Returns 'SEQUENTIAL' or 'DIRECT', | Character variable, array element, | | | depending upon whether specified | substring, or scalar record field. | | | unit or file is connected for | | | | sequential or unit access, | | | | respectively. If the file is not | | | | connected, acc is undefined. | | | | | | ----------------------------------------------------------------------------------------------- | | | | | seq | Returns 'YES' if connected for | Character variable, array element, | | | sequential access, 'NO' if not | substring, or scalar record field. | | | connected for sequential access, | | | | and 'UNKNOWN' if the processor is | | | | unable to determine the access | | | | type. | | | | | | ----------------------------------------------------------------------------------------------- | | | | | dir | Returns 'YES' if connected for | Character variable, array element, | | | direct access, 'NO' if not | substring, or scalar record field. | | | connected for direct access, and | | | | 'UNKNOWN' if the processor is not | | | | able to determine the access type. | | | | | | ----------------------------------------------------------------------------------------------- Table 3-7. (cont.) ----------------------------------------------------------------------------------------------- | | | | | Item | Description/Default | Restrictions | | | | | ----------------------------------------------------------------------------------------------- | | | | | fm | Returns 'FORMATTED' if connected | Character variable, array element, | | | for formatted data transfer, | substring, or scalar record field. | | | 'UNFORMATTED' if connected for | | | | unformatted data transfer, and is | | | | undefined if the file is not | | | | connected. | | | | | | ----------------------------------------------------------------------------------------------- | | | | | fmtd | Returns 'YES' if connected for | Character variable, array element, | | | formatted data transfer, 'NO' if | substring, or scalar record field. | | | connected for unformatted data | | | | transfer, and 'UNKNOWN' if the | | | | processor is unable to determine | | | | the format of data transfer. | | | | | | ----------------------------------------------------------------------------------------------- | | | | | unf | Returns 'YES' if connected for | Character variable, array element, | | | unformatted data transfer, 'NO' if | substring, or scalar record field. | | | connected for formatted data | | | | transfer, and 'UNKNOWN' if the | | | | processor is unable to determine | | | | the form of data transfer. | | | | | | ----------------------------------------------------------------------------------------------- | | | | | rcl | Returns the record length of the | INTEGER*4 variable, array element, | | | specified unit or file connected | or scalar record field. | | | for direct access, measured in | | | | bytes;. If the file is not | | | | connected for direct access, rcl | | | | is undefined. | | | | | | ----------------------------------------------------------------------------------------------- | | | | | nr | nr is assigned the next record | INTEGER*4 variable, array element, | | | number to be read or written on | or scalar record field. | | | the specified unit or file; if no | | | | records have been read or written, | | | | nr = 1; if the file is not | | | | connected for direct access or its | | | | status is indeterminate, nr is | | | | undefined. | | | | | | ----------------------------------------------------------------------------------------------- | | | | | blnk | Returns 'ZERO' or 'NULL', | Character variable, array element, | | | depending upon the blank control | substring, or scalar record field. | | | in effect. If the specified file | | | | is not connected or not connected | | | | for formatted data transfer, blnk | | | | is undefined. | | | | | | ----------------------------------------------------------------------------------------------- | | | | | mrec | See "Semantics". | Integer variable, array element, | | | | or scalar record field. | | | | | ----------------------------------------------------------------------------------------------- | | | | | node | See "Semantics". | Integer variable, array element, | | | | or scalar record field. | | | | | ----------------------------------------------------------------------------------------------- | | | | | cctl | See "Semantics". | Value not checked. | | | | | ----------------------------------------------------------------------------------------------- | | | | | dfile | See "Semantics". | Value not checked. | | | | | ----------------------------------------------------------------------------------------------- | | | | | kyd | See "Semantics". | Value not checked. | | | | | ----------------------------------------------------------------------------------------------- | | | | | org | See "Semantics". | Value not checked. | | | | | ----------------------------------------------------------------------------------------------- | | | | | rectp | See "Semantics". | Value not checked. | | | | | ----------------------------------------------------------------------------------------------- Semantics If the ERR specifier is present and an error occurs during the execution of the INQUIRE statement, control transfers to the specified statement rather than aborting the program. If the IOSTAT specifier is present and an error occurs, the error code is returned in the ios variable and the program is not aborted. Refer to Appendix A for IOSTAT error codes. Either the UNIT or FILE specifier, but not both, must be present in the specifier list. If the prefix UNIT= is omitted and the unit specifier is present, unit must be the first item in the list. Most of the information described in the syntax table is assigned through the OPEN statement; see "OPEN Statement (Executable)" . When a variable is specified in the syntax table as undefined, its value may or may not be changed from its previous value by the INQUIRE statement. Therefore, the value is meaningless if the file or unit either does not exist or cannot be accessed at the time the INQUIRE is executed. The following specifiers, extensions to the ANSI 77 standard, are included for compatibility with programs originally written in another version of FORTRAN. CARRIAGECONTROL MAXREC RECORDTYPE DEFAULTFILE NODE USE KEYED ORGANIZATION If used in a program, their syntax is checked, but they are otherwise ignored by the compiler. ACCESS=acc will return acc=`SEQUENTIAL' for files opened with ACCESS=`APPEND'.


MPE/iX 5.0 Documentation