Jerry Adams wrote:
You can either change the preceding sort to a data sort and the program to use that file, or put an index over the table and use that (in either the RPG II program or a re-written ILE RPG program).

Think of the R/A as a sort of list of pointers to the records, ordered by the sort. The compiler does all the magic of fetching in the record that relates to the pointer, so all you the RPG programmer need to do is assume that the records are being read like a primary file, ordered by the sort. You can basically ignore the R/A part of it.

What do you need to change? This is almost certainly a report, so I can't imagine the change is too drastic to be done with the program in its current state. If you really can't wrap your head around it, the next step is OPNQRYF to replace the sort, delete the E spec and change the F spec to IP. If it's the cycle that's causing blurry vision then I guess a rewrite is in the cards. Just think of the ADDROUT (address record output) file as a black box that lets you read the records in order.
--buck

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.