Hi Alan,

I hadn't read up on %list, so I wasn't sure what this use case is supposed to determine.  I looked it up in the spiffy new IBM Documents and found


which says %list returns a temporary array.  So I it appears that %list(a:b) = %list(c:d) is asking if each element of the first array matches each corresponding element of the 2nd array.  Is that the idea?  Does that work with permanent arrays?

The next question that occurred to me is what are the field types of Q.CLADTE and Q.CLATME?  Guessing purely by the names, it looks like a date field and a time field.  Back to the documentation, which says "The operands must all have a compatible type.".

Is a date field compatible with a time field?  IBM provided a link to answer that question right there where it's needed:


The interesting thing there is that not only did it not answer the question, but the person writing it started having problems with date vs data, e.g.

    "If all the operands have date type time, the result has data type time with format *ISO."

* "If all the operands have date type pointer, the result has data
type pointer."

It's unclear based on that website whether a date field is compatible with a time field.  On the one hand, is 04/07/2021 compatible with 10:06:23?  It's possible that the compiler would convert both to a timestamp field internally, and therefore they would be compatible, but I really don't know.

Btw, I used the "Contact IBM" link at the bottom of the page to let IBM know.

*Peter Dow* /
Dow Software Services, Inc.
909 793-9050
petercdow@xxxxxxxxx <mailto:petercdow@xxxxxxxxx>
pdow@xxxxxxxxxxxxxx <mailto:pdow@xxxxxxxxxxxxxx> /

On 4/7/2021 5:57 AM, Alan Cassidy wrote:
A colleague where I work tried to use @list() like this:

          if  (Deleting)
          and (%list(Q.CLADTE: Q.CLATME) = %list(CLADTE: CLATME)); // Compiler cannot handle

And he got a compiler error:

He was trying to find somebody who could submit a PMR.

I thought that was a cool application of it. I've always wished we had a way to make comparisons with this syntax. Not only for the equal comparison, but how much simpler a *LE comparison would be for opening an SQL cursor with a SETLL type comparison, with four key columns!

--Alan Cassidy

As an Amazon Associate we earn from qualifying purchases.

This thread ...


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

