Well...thanks for that advice Buck.
Obviously there is more to the decision to rewrite than simply because the
program has a record address record file in it, but I could see where you
might get that impression because I did not go into every detail of my
reasoning for electing to rewrite this functionality in my reply.
The program is used for more than creating a spooled file, by the way. In
fact, this particular program does not create a report at all but rather a
database that is used for other reasons.
Thanks again for the input!
Shannon O'Donnell
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Buck
Sent: Wednesday, October 17, 2007 1:18 PM
To: rpg400-l@xxxxxxxxxxxx
Subject: Re: RPG II question
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.