× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Yeeesss that is the answer. I was having the same issue and putting the
whole "true" expression within parentheses after the "NOT" should solve the
problem.

JS

El jue, 17 ago 2023 a las 4:39, Vern Hamberg via MIDRANGE-L (<
midrange-l@xxxxxxxxxxxxxxxxxx>) escribió:

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 loaded
using SQL FETCH including a column data_type defined as a varchar(8).
RowsFetched contains the number of columns defined. I would like to
verify
that all the data_types defined agree to a list of values ('NUMERIC' or
'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
indicator
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

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.