Talk:IBM RPG

info
Actually the RPG cycle exactly mirrors the IBM 401/402/403 electro-mechanical Accounting machines. The Language is actually an emulation of those machines in Software. While the "language" was introduced later anyone who had programed the unit record devices using Plug-boards and wires could easily write the "code" that matched the "wiring diagram" for a plug board program. — Preceding unsigned comment added by 50.38.94.190 (talk) 06:01, 26 February 2020 (UTC)

OOP
The text says that OOP features where added to RPG, but the features metioned doesnt seem so OOP, except static/dynamic binding. Perhaps I am picky...

Agreed - this is not OOP. I don't know anything about RPG but the information given here does not back up the claim that it has OOP features. Thparkth (talk) 11:56, 23 May 2008 (UTC)


 * I believe that's correct, Thparkth. I've been programming in RPG for about 25 years, and am very familiar with it.  While I love RPGIV, it is not an OOP language.  IBM agrees, stating,  "...C++ code is more difficult to call from RPG or COBOL programs. These two languages are not object-oriented, so it is easier to call a C function than a C++ method of an object..."  The Dogfather (talk) 19:30, 23 May 2008 (UTC)

Advertisement
I removed this advertisement for a book due to obvious POV issues:


 * "Who Knew You Could Do That with RPG IV? A Sorcerer's Guide to System Access and More" is a redbook focused on RPG IV as a modern, thriving, and rich application development language for the 21st century. It is written for those AS/400 system programmers that are in the cusp between RPG/400 and RPG IV and are looking for hints and tips to make the move forward worth their while. This book promises to drop little golden nuggets of information in the form of code samples and style guidelines. Picking up each golden nugget will lead you step-by-step down the path that will eventually allow you to take full advantage of RPG IV and the Integrated Language Environment (ILE). Even the most experienced RPG IV programmer will find something useful in this redbook.

It sounds almost like it was copied right off the back cover of the book, especially toward the end, and I see no evidence that this book is more notable than every other RPG IV book. Please do not re-add this content until these issues are settled. Deco 00:18, 16 January 2006 (UTC)

N.B. The redbook is downloadable for free in PDF format (following the link above) where it has received a five star rating from the user community, so the above text is an advertisement in the true sense of the word but might not be considered to be a commercial advert, even though a hard copy is available for purchase.

BASIC?
The two languages available at the time RPG was first introduced were COBOL and Fortran. BASIC came along in the mid- to late-1960s as a timesharing language at Dartmouth College. It was the Beginner's All-Purpose Symbolic Instruction Code. The BASIC of today retains the clumsiness of the original BASIC with a patina of object-orientedness. So, this article on RPG takes a backward glance at RPG's history without fully understanding the history or context. I think RPG originally generated COBOL source decks from RPG source decks. If you don't know what a "deck" is then perhaps you shouldn't be writing very much about history. (by 70.108.195.219)


 * Really? Look at this page and you'll see that it's not quite like that. BASIC came out the same year as RPG, but it was designed as a teaching language, not a commercial one. RPG in it's earliest forms was basically just a set of rules acted on by a big loop so I'm sure it didn't take anywhere near the resources of COBOL (or Fortran, Algol, PL/1 etc). There may have been implementations that compiled to COBOL, but for RPG II on the System/3 (decks of 96 hole cards!) that *certainly* wasn't the case. Snori

@Snori actually RPG design dates back to the Electro-mechanical 402 accounting machine a unit-record device that could be interconnected with a 514 punch - (programing was done by plug-boards) so it technically it predates CoBOL and ForTran by a long time. — Preceding unsigned comment added by 50.38.94.190 (talk) 05:51, 26 February 2020 (UTC)

RPG II for System 360
The comment in the History section, "RPG was further developed by IBM for their range of mainframe systems, especially the S/360 - as RPG II" is wrong.

I worked on System 360s from the mid-sixties until the entry of the S/370. We had an RPG compiler in our shop and I used it for some reporting work running the BPS (Basic Programming Support) operating system. I don't believe RPG ran under the TOS or DOS, but I could be wrong.

RPG II was the flagship language with the introduction of the IBM System/3 in 1970. I worked on converting a System 1130/Fortran system to one of the first System/3 Mod 10's delivered in the U.S. RPG II was a very strong language for small business programming as long as applications focused on printed reporting. It was common for us to invent our own disk indexing systems to make up for limitations in the built-in facilities.

RPG was basically a non-entity on IBM mainframes, always second to COBOL in business shops. You could say that COBOL was the primary business language of S/360 and IBM'S Data Processing Division (basically big business),

RPG was used extensively on the IBM 360 Mod 20 but that machine quickly became the domain of IBM's new General Systems Division. It was also common for GSD to sell some small businesses the IBM 1130 using Fortran with Commercial sub-routines. However, the 1130 was part of IBM's scientific group and was always intended as a floating point scientific machine. It's use as a business computer was a stop gap measure for small companies that could not afford a Mod 20.

RPG II was the primary business language of System/3 and the introduction of System/3 was a major breakthrough for IBM's General Systems Division.

With the advent of GSD's Sys/3 Model 15 running RPG II and CCP, the GSD began competing directly with DPD for customers. The Mod 15 was strong enough to compete head-on with lower-end S/370 machines. This was very convenient for IBM at the time because they were undergoing a long anti-trust battle.

There should be some collaboration and then a clean-up of the History section.

Hope this helps, --YORD-the-unknown 22:49, 7 July 2006 (UTC)


 * My first job (as a Trainee Programmer) in 1978 was in a shop with a System/3 Model 15D. The version of RPG was definitely RPG II. RPG III came into existence later on the System/38. In 1982, I also worked very briefly in RPG II on an IBM 4331 running DOS/VSE. The major language of that shop was PL/1. Cymruisrael 07:45, 16 July 2006 (UTC)


 * How right you are. RPG III came in with System/38.  BTW, PL/1 was really an advanced language that I always thought should take the place of COBOL but IBM was always noted for its focus on backward compatibility.  For this reason, COBOL remained dominant in the mainframe shops and RPG (and all varieties) remained dominant in what came to be know as the mid-range shops.  --YORD-the-unknown 14:28, 16 July 2006 (UTC)


 * Another correction. The System 3 card system was introduced in 1969, but the disk based system was introduced in 1970. I never worked on the card system but our shop was one of the frist 10 shops to implement the disk system.  Getting the timeline straight is a little bit more challenging after 30+ years. --YORD-the-unknown 14:37, 16 July 2006 (UTC)

I used RPG (I) on System 360/20 with a self loading card deck compiler, and under DOS on 360/30. Also RPG II under DOS/VSE on a 4331. It was certainly use for much more than reports -- any read/process/write type of batch application was a candidate. Georget99 (talk) 15:35, 26 May 2010 (UTC)

Rarity among offered courses
How valuable does anyone think it would be to mention that not too many colleges/universities teach this anymore? I've attended and/or looked into roughly eight colleges between MI and AZ, and only one of them offers any AS/400+RPG at all, and it's all introductory stuff.


 * When the Association for Computing Machinery (ACM) published the History of Programming Languages in 1996, RPG was not memtioned. Nonetheless, RPG in all of its forms has powered hundreds of thousands of businesses for decades.  I can understand why RPG, even in its newest form, isn't taught in colleges and universities, there are simply too many superior programming languages to choose from.


 * Interestingly, the driving forces behind COBOL (Grace Hopper), C (Kernigan & Ritchie), SmallTalk (Alan Kay) and other important programming languages are well known, but does anyone have citable evidence as to who the individual(s) is who was who invented RPG? YORD-the-unknown 18:51, 12 September 2006 (UTC)


 * Wilf Hey CharlesWT (talk) 01:42, 16 July 2008 (UTC)

External link to IBM manual broken (at least when I tried it)
External links IBM (1964). IBM 1401 RPG manual. C24-3261-1. —The preceding unsigned comment was added by 81.153.236.173 (talk) 11:31, 15 February 2007 (UTC).

Windows
Does RPG run on Windows? Can anyone give more information on this, because I think it's impossible. —Preceding unsigned comment added by 81.83.46.237 (talk) 09:49, 18 November 2008 (UTC)


 * It should probably be struck out of the list unless a reference can be provided proving it does. blades (talk) 07:29, 6 January 2009 (UTC)


 * There is (or was) the Lattice RPG compiler. Visual RPG also runs on Windows. The Dogfather (talk) 14:24, 6 January 2009 (UTC)

There was a IBM PC like device that was a portable size 370PC that used it. Also a company replicated an system for IBM PC that ran as a port of the IBM system 34/36 (well actually probably also a system 32 - compatibility mode compiler worked — Preceding unsigned comment added by 50.38.94.190 (talk) 05:30, 26 February 2020 (UTC)

Awk?
''every RPG program executes within an implied loop, which can apply the program to every record of a file. At that time each record (individual punch card) would be compared to each line in the program, which would act upon the record, or not, based upon whether that line had an "indicator" turned "on" or "off"''

Is it just me, or does this sound exactly like awk? blades (talk) 07:32, 6 January 2009 (UTC)


 * Yup. The phrase "The concept of level breaks and matching records is unique to the RPG II language." is purest rubbish, contemporary languages had similar feaures (NICOL on the ICT 1900 for example), and awk is pretty obviously based on the same idea. HughesJohn (talk) 07:15, 31 March 2011 (UTC)


 * Perhaps RPG was the first language to use this feature? Then it might be noteworthy but in an other wording? — Preceding unsigned comment added by 192.109.140.187 (talk) 05:49, 12 June 2013 (UTC)


 * awk is indeed similar in structure to the RPG cycle, but level breaks and matching record logic is not, as far as I can tell, one of the features of awk. RPG level breaks are a feature associated with the report generation capabilities of RPG. They allow you to define "key" structures to match the records read, and print totals and headers when one of the keys change. Modern reporting tools like Crystal Reports does indeed contain level break logic. Matching records is even more complex. This involves reading of records from multiple files or record formats, and sets indicators (boolean flags) when certain predefined portions of these records match. I have never needed this sort of processing, but it was used, I believe, to process transactions such as customer orders that were stored in multi format files. A simple example would be header and detail records for an order all in a single file. Positions 1-0 might contain an order number in both record formats. You could set an indicator that would be on when the order number in the currently read record matched the previously read record. I believe this could also be used in merge processes where records were read from multiple files and processed in order based on the record matching indicators.JMarkMurphy (talk) 04:21, 31 October 2017 (UTC)

I wrote lots of RPG II,III and also programed IBM 402 accounting machines - The concept comes from as far back as how the electo-mechanical (motors, relays, etc no valves or transistors etc. ) device operated - the origional RPG mirrors exactly how that machine worked. — Preceding unsigned comment added by 50.38.94.190 (talk) 05:39, 26 February 2020 (UTC)

Current Support
The phrase "RPG IV is the only version of RPG supported by IBM on its long-line of successors to the AS/400 system." is not exactly correct. It is only correct to the point that if you find a bug in the RPG II or III compiler, you are on your own. You cannot purchase support for it from IBM. You can run and compile RPG II, III, and IV programs on the most recent version of IBM i (v7.1). You can also purchase the compilers from IBM to do so. Though RPG II is uncommon on these boxes, it is not totally extinct yet. A more accurate presentation would be that RPG IV is the only version of RPG that is currently maintained by IBM. Unsupported sounds like you can no longer execute the programs because the support for them has been removed from the OS as happened with BASIC. JMarkMurphy (talk) 18:19, 13 September 2011 (UTC)
 * As a one-time 3rd and 4th line support consultant (nothing to do with IBM) I would say that generally understood meaning of 'unsupported' is that you cannot ask for fixes or problem avoidances. It does not necessarily imply that the code will not work. Pterre (talk) 19:00, 13 September 2011 (UTC)


 * Yet the Platforms section states "RPG II applications are still supported under the IBM z/VSE and z/OS operating systems, HP MPE operating system on HP3000 and the OpenVMS operating system on VAX, Alpha, and Unisys MCP", even though you cannot purchase support from IBM for RPG II on any platform. My take on unsupported is that it means "probably won't work without some effort on your part".  RPG II works just as well on modern Power Systems running IBM i as it ever did on the System/36 or AS/400 "supported". JMarkMurphy (talk) 18:13, 21 October 2011 (UTC)
 * In my experience support is not given where a given combination of s/w version and o/s version has not been tested. It does not imply that the s/w will not work, just that it has not been tested and confirmed to work. If it does not, you are on your own. A slightly greyer area is where formerly supported s/w is withdrawn from support for commercial reasons, probably because it is too old to be worth continuing to support. It is after all expensive to maintain numerous combinations of old versions of hardware, o/s, s/w, developer skills, etc, indefinitely, on the off-chance that an obscure problem will be found years after release. Pterre (talk) 15:16, 22 October 2011 (UTC)
 * Bottom line - Your program compiled in RPG II or RPG III will work and compile on modern IBM hardware. If IBM does anything to break it, they will fix it.  It will work the same as it always has.  If some new obscure problem is found, then you are on your own.  They would not offer the compilers for sale if they weren't going to make sure they work.  The products are 'Stabilized' in IBM talk.  Meaning that they will not be improved upon, but they will indeed work as they always have.  I consider RPG II and RPG III tested and guaranteed to work on all AS/400, iSeries, System I, i5, and Power systems under OS/400, i5/OS, and IBM i.  Choose the correct combination. JMarkMurphy (talk) 22:30, 8 November 2011 (UTC)

"RPG IV was released in 1994" ?
A 1972 Varian brochure lists an "RPG IV" compiler as included in the software package for its "73" model. Follow this link for more details. --BjKa (talk) 11:09, 28 February 2017 (UTC)


 * Very interesting. It took me a while to find the RPG reference, so I'm posting a link to the pdf where I found the reference to RPG IV.  So there have been at least two "RPG IV"s... Thanks for the info! Jacona (talk) 11:31, 28 February 2017 (UTC)

RPG/400 vs. RPG III
"RPG/400 was effectively RPG III running on AS/400. IBM renamed the RPG compiler as "RPG/400" but at the time of its introduction it was identical to the RPG III compiler on System/38. The rebranding took place to differentiate between the earlier CISC (Complex Instruction Set Compiler) on the beige boxes to the later, "faster" RISC (Reduced Instruction Set Compiler), usually on the black servers. Virtually all IBM products were rebranded as xxx/400 and the RPG compiler was no exception. RPG III compiled with the RPG/400 compiler offered nothing new to the RPG III language until IBM began development of new operation codes, such as SCAN, CAT and XLATE after several years of AS/400 availability. These enhancements to RPG III were not available in the System/38 version of RPG III."

This is not really true, RPG III was rebranded RPG/400 to differentiage between System/38 RPG III and AS/400 RPG/400. By the time RISC machines came along, IBM had released RPG IV. Maybe the confusion here is when the box transitioned to RISC. That transition occurred during V3 of OS/400 V3R1 and V3R2 were for the CISC beige boxes, and V3R6 and V3R7 were for the RISC black boxes. In fact, V3R2 and V3R6 were the same OS, one for CISC boxes, and one for RISC boxes, and released approximately concurrently. This is a testament to how quickly the AS/400 shifted from a 48 bit CISC environment to a 64 bit RISC environment. It occurred virtually over night, and programs compiled on V3R2 could be saved and restored on a V3R6 box as long as a property called observability had not been removed. The save and restore conversion could also occur from RISC to CISC, to support companies whose development environment was on a new RISC box, but whose production environment was still on an older CISC box.JMarkMurphy (talk) 03:59, 31 October 2017 (UTC)

COBOL report writer
At one time COBOL had a report writer feature; as I recall, it was added by CODASYL and removed in a subsequent round of standardization. Should the article compare it to RPG, or at least mention it? Were there similar features in, e.g., COMTRAN, FACT? --Shmuel (Seymour J.) Metz Username:Chatul (talk) 20:07, 14 June 2021 (UTC)