(j3.2006) Inconsistency between OPEN and INQUIRE
Van Snyder
Van.Snyder
Tue Oct 18 20:17:57 EDT 2016
For a formatted connection, all specifiers in the INQUIRE statement that
inquire the value of a corresponding specifier in the OPEN statement
return the same value, or the default if a specifier didn't appear,
except ENCODING.
In the OPEN statement (12.5.6.9) the value of the ENCODING specifier is
required to be UTF-8 or DEFAULT. If it's not specified, the default
value is DEFAULT. If a unit is connected other than by an OPEN
statement, defaults apply, so the value of ENCODING is DEFAULT.
In the INQUIRE statement (12.10.2.10), the values returned are UTF-8 if
the connection has UTF-8 encoding, UNDEFINED if the connection is not
for formatted input/output, and UNKNOWN otherwise. 12.10.2.10 says "if
the processor is unable to determine the encoding of the file or if the
unit... is not connected to a file."
If the unit is connected to a file, even preconnected to a file that
does not exist, it would seem reasonable to return DEFAULT if that was
the value used or assumed by default in the OPEN statement, or if the
unit was preconnected and opened by other than an OPEN statement.
Is there a reason for this inconsistency?
More information about the J3
mailing list