|
Vern:
Thanks for the on the money response.
i usually wrapper my logical expressions in parentheses but hadn't
considered that for my first use of IN.
Jack
On Thu, Aug 17, 2023 at 6:39 AM Vern Hamberg<vhamberg@xxxxxxxxxxxxxxx>
wrote:
Hi Jack
I put your code into RDi with declarations and filled the array. I got
the same error. The nice thing about RDi is, it highlighted the exact
point of the error - it said that " data_type", the element, was not
compatible with an operator - that operator is "NOT". The compile
listing, even with *SECLVL, doesn't help here.
Problem is hierarchy of operations. Seems "NOT" is done first here,
before "IN".
So it works to put parenthese around the IN expression, as here -
IF NOT (FV(i).data_type IN %list('NUMERIC' :'CHAR'));
So I recommend using RDi with *EVENTF compile option and interactive
compile.
Regards
Vern
On 8/16/2023 10:04 PM, Jack Callahan wrote:
Have an data structure FV to hold column details for a given table loadedverify
using SQL FETCH including a column data_type defined as a varchar(8).
RowsFetched contains the number of columns defined. I would like to
that all the data_types defined agree to a list of values ('NUMERIC' orindicator
'CHAR'). Tried a code snippet looks something like this:
isValid = '1';
FOR i=1 TO RowsFetched;
IF NOT FV(i).data_type IN %list('NUMERIC' :'CHAR');
isValid = '0';
ENDIF;
ENDFOR;
Compile fails with RNF7421, to wit:
"Operands are not compatible with the type of operator.
Cause . . . . . : Operands must be of class character, graphic, or UCS-2
for character operations; numeric for arithmetic operations; and
for logical and relational operations. In a comparison operation, both
operands must have the same data type. The specification is ignored."
Obviously I can convert the IN to a compound logical comparison to make
the program work.
What I'd like to learn is what data type is being assigned to the %list
expression terms. I can't seem to make the terms compatible. Or is the
problem using an element of the data structure as one of the terms? Or is
it something else altogether?
Any thoughts welcome
Jack
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.