INQUIRE - file or unit

INQUIRE - file or unit

The INQUIRE statement is used to find out the properties of a particular named file or of the connection or availability of a particular unit. The INQUIRE statement may be executed before, while or after a file is connected to a unit. All values assigned by the INQUIRE statement are those that are current at the time of the statement. It has the following specifiers associated with it:

UNIT=<value>
<value> specifies the unit number for INQUIRE by unit. The keyword and equals sign are optional if this is the first specifier in the list.

FILE=<string>
<string> specifies the filename for INQUIRE by name. UNIT must not be used if is used and vice-versa.

IOSTAT=<variable>
<variable> specifies an integer variable into which the input/output status may be written.

ERR=<label>
<label> is a label to jump to in the event of an error.

EXIST=<variable>
<variable> specifies a logical variable that will be set true if the file or unit exists, otherwise false.

OPENED=<variable>
<variable> specifes a logical variable which will be set true if a connection exists to the file or logical unit number, otherwise false.

NUMBER=<variable>
<variable> is the variable into which the unit number attached to the file is written, or -1 if the file is not attached to a unit.

NAMED=<variable>
<variable> is set to true if the specified file is named, otherwise false.

NAME=<variable>
<variable> will contain the name of the file (if named) or undefined.

ACCESS=<variable>
<variable> will contain the access type for which the unit or file is opened. This will be SEQUENTIAL, DIRECT or UNDEFINED.

SEQUENTIAL=<variable>
<variable> will contain YES, NO or UNKNOWN depending on whether the file or unit is opened for sequential access.

DIRECT=<variable>
<variable> will contain YES, NO or UNKNOWN depending on whether the file or unit is opened for direct access.

FORM=<variable>
<variable> will contain FORMATTED or UNFORMATTED depending on the connection to the file or unit.

FORMATTED=<variable>
<variable> will contain YES, NO or UNKNOWN depending on whether the file or unit is opened for formatted file operations.

UNFORMATTED=<variable>
<variable> will contain YES, NO or UNKNOWN depending on whether the file or unit is opened for unformatted file operations.

RECL=<variable>
<variable> will contain the maximum record length for a formatted or unformatted file, or undefined if there is no connection.

NEXTREC=<variable>
In direct access files, <variable> will contain one more than the last record number read (records start at 1) or undefined if the position is not known.

BLANK=<variable>
<variable> will contain 'NULL', 'ZERO' or 'UNDEFINED', depending on the connection to the unit number or file.

POSITION=<variable>
<variable> will contain 'REWIND', 'APPEND', 'ASIS' or 'UNDEFINED' depending on the connection to the unit or file.

ACTION=<variable>
<variable> will contain 'READ', 'WRITE', 'READWRITE' or 'UNDEFINED' depending on the connection to the unit or file.

READ=<variable>
<variable> will contain 'YES', 'NO' or 'UNKNOWN' depending on the connection to the unit or file.

WRITE=<variable>
<variable> will contain 'YES', 'NO' or 'UNKNOWN' depending on the connection to the unit or file.

READWRITE=<variable>
<variable> will contain 'YES', 'NO' or 'UNKNOWN' depending on the connection to the unit or file.

DELIM=<variable>
<variable> will contain 'APOSTROPHE', 'QUOTE', 'NONE' or 'UNDEFINED' depending on the connection to the unit or file.

PAD=<variable>
<variable> will contain 'YES' or 'NO' depending on the connection to the unit or file.

 

 

Basket
Empty
 
Copyright © 1999-2024 Silverfrost Limited