(j3.2006) Inconsistency between OPEN and INQUIRE
Robert Corbett
robert.corbett
Tue Oct 18 21:03:39 EDT 2016
On 10/18/2016 5:17 PM, Van Snyder wrote:
> 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?
I would assume that the INQUIRE statement should return the name of
the encoding for the connection instead of DEFAULT if it knows what
the encoding is.
Bob Corbett
More information about the J3
mailing list