%FOUND and %EQUAL are different. If you are looking for the exact same
values as in the key list, use %EQUAL. %FOUND gets set on if there's
anything with a value greater than the key list values. From the manual:

The resulting indicators reflect the status of the operation. You can
specify an indicator in positions 71-72 that is set on when the search
argument is greater than the highest key or relative record number in the
file. This information can also be obtained from the %FOUND built-in
function, which returns '0' if no record is found, and '1' if a record is
found. 

In your case, let's say you have company numbers 1, 2, 3, and 4 in the file.
If your keys are 3 (for the company), and anything for the date, %FOUND will
always be on, regardless of the date, because there is a higher value (4) in
the file. That may not be what you are looking for.

At least, that's my understanding. Perhaps Barbara can clarify.

Francis Lapeyre
IS Dept. Programmer/Analyst
Stewart Enterprises, Inc.
E-mail: flapeyre@xxxxxxxx 


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Mike Waite
Sent: Friday, May 12, 2006 3:25 AM
To: rpg400-l@xxxxxxxxxxxx
Subject: SETLL and No Record condition

How often do people use SETLL and HI/%FOUND, rather than the more usual
EQ/%EQUAL?

I've only ever it once, when positioning a file using a best-guess starting
date (see below).  But I suspect I should be using it more often...


Mike


 
  *. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ...+.
  *
  * Use the date sequence audit file to get the order no. start point
  * - trap future date (just pick last record as best starting point)
  * 
 C     #Key40        setll     oep40kl2                           99 
 C                   if        %found 
 C     l#cono        reade     oep40kl2 
 C                   else 
 C     l#cono        readpe    oep40kl2 
 C                   endif 
  *
  * Key for Orders
  * company code, starting date cyymmdd 
 C     #Key40        klist 
 C                   kfld                    l#cono 
 C                   kfld                    StrDate 
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or
change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/rpg400-l.

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

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.