× 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.



Mark,

Well done (as always).

I am one of those who usually avoids the cycle in RPG.

It was a conscious decision, maybe lame, but because
I was also worked on other platforms/languages, I
justified the decision thinking any programmer with
a good foundation could maintain the code.

To your point about 3GL/4GL:

In my second semester COBOL class, Gordon Frisby, (whom I will
never forget and owe a debt of gratitude) introduced a COBOL
"feature" that automated most of the three file match/merge
logic required in the project that was the final practicum in
first semester.

To your point about RPG and display files:

Vastly reduced the code required to make a conversational program
using COBOL with an IMS database on the old mainframe os!

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Mark S Waterbury
Sent: Thursday, April 11, 2013 7:29 AM
To: RPG programming on the IBM i (AS/400 and iSeries)
Subject: Re: why rpg and not cobol

COBOL is a 3GL. RPG is closer to a 4GL ... perhaps a "3 1/2 GL"...
especially when used with the cycle, as originally intended, for producing reports. With the cycle, lots of stuff is done for you automatically, so you only have to specify the I-specs (what the input looks like), the O-specs (what you want the output report to look like), and perhaps some Calc-specs to do any special computation for each record. It follows the I-P-O (Input-Process-Output) model.

But, for some reason, on the System/38 and early AS/400, many RPG III or
RPG/400 programmers religiously avoided the cycle, perhaps due to perceived poor performance on early underpowered IMPI machines, or perhaps just because they wanted to be "in control" of exactly what their program was doing. In any case, I recall many times seeing RPG programs written using "full procedural" style, but when you examine the code, what you find was that the programmer had "re-invented the wheel"
and "hand-coded" the cycle in RPG. =-O This approach reduces RPG to a 3GL, "throwing out the baby with the bath water" ... IMHO.

If you look at how display files work, especially with subfiles, with indicators, etc., this is also very "non-procedural" in nature. From the point of view of the programmer, you just write some records to the subfile, then you write the subfile control record, and the whole subfile screen is displayed, and, depending on how you coded your DDS, the system takes care of all the paging (roll up and roll down), etc.
for you. This is one aspect of OS/400 applications development that is often hard to grasp for typical 3GL programmers coming from other platforms, I think in large part because IBM failed to adequately explain that "display files are declarative (non-proedural) in nature."
This is also why it is difficult to create a web (browser) interface that exactly mimics all of the built-in behaviors of display files.

With ILE RPG IV, especially /free form, it is less of a 4GL and more of a 3GL than the old RPG, though you can still use the cycle and some other features, (like "matched records", etc.). The number of lines of code to do any given task in RPG vs. COBOL will usually favor RPG, because COBOL is much more verbose.

Mark

On 4/11/2013 9:13 AM, Michael Ryan wrote:
COBOL is a fine language. RPG is a fine language. There are nuances,
and certainly syntax differences, but they're about the same from a
programmer perspective (IMO). I haven't written COBOL in a number of
years, but I can remember writing RPG all day and COBOL at an extra
gig at night. I was equally productive I think.



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

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.