× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Paul

What a great description of the rpg cycle. I never put 2 and 2 together
to see how much we used to do with matching records back in the mid 70's.
The analogy to join logical was great.

When push came to shove and I had to -not- use the cycle for report
writing I also developed a standard /copyable mainline to emulate it no
matter how the data was retrieved. It just standardized things so well.
The concept of L1 at detail time, detail time, L1 at total time just
worked with no effort.

Still when I have to modify an old report that uses the cycle, I just
create an sql "feeder program" and use the special file techniques that
Ted Holt describes. Quick, easy and no errors introduced. If it's not
broke I fix it as little as possible.

Thanks again

Jim Horn

This email is intended only for the person or entity
to which it is addressed and may contain information
that is privileged, confidential or otherwise protected
from disclosure. If you are not the named addressee
or an employee or agent responsible for delivering
this message to the named addressee, you are not
authorized to read, print, retain copy, and disseminate
this message or any part of it. If you have received this
message in error please notify us immediately by email,
discard any paper copies and delete all electronic files
of this message.

message: 4
date: Sat, 25 Aug 2007 14:38:39 -0400
from: PaulMmn <PaulMmn@xxxxxxxxxxxxx>
subject: Re: RPG Cycle

Oh, Alan, Alan, Alan... what a can of worms you've opened! (:

RPG stands for Report Program Generator. It is assumed that you want
to use all of the files you have listed, or they wouldn't be listed
in the first place, so the machine opens them for you. Unless you
condition the F specs with the 'user controlled' option, all files
are opened when the program starts, and closed when the program ends.
No need to trouble your mind with the details-- that's what the
system's there for!

The Cycle uses the old HIPO logic: Hierarchy-- Input / Processing /
Output. So, the system will read a record for you and present the
data to you for processing. You then manipulate things, and make
data ready for output. The system 'puts' the records you specify,
then makes another record ready for your use. No need to fiddle with
DOWHILE and DOUNTIL logic; no need to worry about where is the best
place to locate the "prime the pump" read-- in the loop or outside.

*INZSR isn't needed. You condition Detail Calculations using the 1P
indicator if you want things initialized.

Lessee-- Matching Record logic in 10 minutes...

The fields you define with the Matching Field Indicators should be in
1-to-1 correspondence with the key fields on the files being matched,
and with the Level Indicators.

Once the indicators and key fields are aligned, Matching Record logic
reads multiple files as if they were merged into a single file sorted
by the Matching Fields. Period. Think "Join Logical."

The primary file is read first if both a primary and secondary
"match." If you have multiple secondary files that match, the
records are presented one-at-a-time. The Record Resulting Indicators
you specified tell you which record is available for your use.

That's it. And the Matching Indicators turn on to indicate which
2ndary file fields 'match' the primary.

RPG easy? You bet! You just have to let the system do the grunt
work so you can concentrate on the calculations!

--Paul E Musselman
PaulMmn@xxxxxxxxxxxxxxxxxxxx

PS-- back when I wrote COBOL programs, I used to code using the RPG
Cycle as my guide for correct logic. Worked beautifully, and no
tangled mess of logic!

PPS-- WAY back when (ca. 1973) IBM's old Data Processing Division
had a learn-it-yourself RPG course. It had a book and a 7" reel of
tape. In about 2 hours it taught the basics of the RPG cycle so you
could write a "hello, world" program. If anyone has a copy of this
beauty, it ranks right up there with Radio Shack's first
learn-it-yourself BASIC manual. Simple, Elegant, not a lot of
details, but you were off and running in just a few hours.

PPPS-- Anyone else remember Chaining using the Extension specs? I
never did it, but I did trip across a few programs at my first job
that did.



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.