(j3.2006) INQUIRE by output list
Malcolm Cohen
malcolm
Tue Aug 20 21:18:29 EDT 2013
>The INQUIRE statement form used to determine a record size has the
>syntax form
>
> INQUIRE (IOLENGTH=<scalar-int-variable>) <output-item-list>
>
>The <output-item> can be a simple variable name. But the rules for the
>syntax term <output-item> appear to require that the variable be
>defined.
Sorry, not seeing it.
"A data object is referenced when its value is required during execution."
So considering an <output-item> that is an <expr> that is a variable name, sure
the expression produces a value, but the point is that this is not actually
required for INQUIRE IOLENGTH=, unless the IOLENGTH= result can depend on the
value produced. I guess that is actually conceivable, if unformatted i/o writes
compressed records (I don't know of any such system). So at worst we have the
situation that the <output-item> in this context *might* be required to be
defined, if the processor needs the value.
FWIW, we (NAG) do undefined variable detection, and do not consider this to be a
case where it is needed to be defined.
Is it worth writing extra syntax (<inquire-item>) to require the processor not
to need the value here? I don't think so, especially as it would involve
duplicating all the <output-item> requirements we actually do want into the new
<inquire-item>; sounds like a cure worse than the disease. Others may differ.
Cheers,
--
................................Malcolm Cohen, Nihon NAG, Tokyo.
More information about the J3
mailing list