This may NOT necessarily be true as a REORG may have been done, then as far as the RRN is concerned, all bets are off.
If the file is to re-use deleted records, again, all bets are off

Alan Shore
Programmer/Analyst, Direct Response
E:AShore@xxxxxxxx
P:(631) 200-5019
C:(631) 880-8640
"If you're going through Hell, keep going" - Winston Churchill

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Voris, John
Sent: Friday, November 11, 2011 9:14 AM
To: rpg400-l@xxxxxxxxxxxx
Subject: %lookup on a Data Structure Array

If you are thinking of manually loading the array at program initialization, then also remember this.

If you decide to load the array from the file - and you believe that now or in the future, you will not be loading ALL the records from the file
- then load the array from the end of the file.
That is end of the file in RRN reverse sequencial order.
Then you are more likely to avoid the inactive no-longer-used records found at the beginning of the file.
In fact, when you interogate the file, you often find that the first records in the file were history records from some conversion effort.
And may not be in use anymore.
This is usually true of customer and order files. Note that files of master codes are usually not like this, and that the codes still in use are scattered throughout the file.

. . . define the array with a max of 100k elements . . .

--
This is the RPG programming on the IBM i / System i (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 ...

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.