A brief history of the IBM RPG Programming Language

  • Home
  • /
  • Blog
  • /
  • A brief history of the IBM RPG Programming Language

September 8, 2009

A brief history of the IBM RPG Programming Language

By NickLitten

September 8, 2009

history, language, programming, RPG

So, there I was this morning sipping my cup of rather disgustingly nauseous Pumpkin Flavored Starbucks Coffee… You gotta try these things, because as my grandpa always said “nothing ventured nothing gained” but sadly the Judges awarded the beverage Color-7 Presentation-8 Taste-Yuk!… but I digress… Where was I? Ah yes, the wonderful IBM RPG Programming Language!

What does programming have to do with an RPG?

Discounting my early forays into BASIC in the early 1980’s, IBM RPG was the first proper programming language I learnt.

Twenty years later I am still blessed to be working with it and it’s evolution is a fun thing which keeps my head in manuals and checking websites to learn new, faster, sharper and shinier ways to write the same style programs I’ve been doing for two decades now.

I didnt realise that my programming language of choice, RPG, is fifty years old. No wonder the young whipper snappers in the office think I’m a seriously aging hippy programmer 😉

This fantastic article gives the skinny… warning only serious pointy headed computer geeks need read on

IBM RPG: A Great Language with a Greater History

Published: August 17, 2009

by Brian Kelly

The IBM RPG programming language is the favorite still of many young and old who toil in the IBM i environment. Amazingly, this language is pushing 50 years old. Though the IT world believes that RPG began with RPG I, there really was an RPG 0 in the pre-1960 era called FARGO, also known as 1401 (Fourteen-o-one) Automatic Report Generation Operation, and this was the immediate predecessor to RPG.

Ibm rpg programming language

So FARGO was really RPG with a bad name and it was really RPG 0. IBM got the name wrong the first time out–as it seems it often does. The intention of the language was obvious. IBM had all these 50 million-ton electromechanical units that its customers were paying a zillion per month to rent. These were the top candidates for a new 1401 computer system–if it could do what those old iron units could do.

This old type of gear was collectively known as unit record equipment. Some called it tab punch card equipment. IBM’s thinking, as it was literally forced to move to the computer age, was why should a computer not perform the same or similar functions as these electromechanical behemoths of the past? The real question was this: How could IBM keep making the same kind of profits in the future as these solid iron guys gave the company us in the past?

With RPG, short for Report Program Generator, IBM changed the name as the FARGO underpinnings were enhanced and the bugs removed. This wackily named product, which had with no relationship to North Dakota, was IBM’s first attempt to take the cyclic nature of the ubiquitous 7,000-pound gorilla accounting machine and emulate it with a programming language. RPG I was the workable formalization of this approach, and so, as the follow-on to FARGO, IBM had great plans for the language.

Making the transition from tab equipment to any computer system would be difficult under all circumstances. Having a tool, such as RPG, that could provide for the same cyclical function as the wired control panel boards made the task much easier than if Fortran or assembly language needed to be used.

So, it was RPG that helped IBM’s clients in the 1960s move from the electromechanical marvels of the 1920s into the 1960s with similar functionality but less work. IBM had never publicly lost money on a new idea at this time in its history. So RPG not only helped IBM’s client set, it also enhanced the revenue picture for Big Blue as the company made its transition into computer technology. The IBM 1401 was the first computer selected by IBM to take on the mission of migrating tab equipment and RPG was the programming language drafted to perform the heavy lifting The IBM 1401 itself was no slouch. IBM built over 20,000 1401 systems, mainly intended for small- and medium-sized businesses. The box was one of IBM’s most successful products.

Among the reasons that RPG and the 1401 had its way with the businesses of the 1960s was because those companies large enough to afford tab punch card equipment were looking for a better way to run their business. The old tab machine technicians were familiar with having to plug wires into control panel boards to “program” these units. Through the boards, these wire “programmers” directed the machine to provide input, output, control, and counter operations (add, subtract, multiply, divide). They did the wiring well enough to run the business and they were the perfect candidates to learn the RPG language.

Tab machines used these wired panels to cause things to happen as instructions were executed by impulses emitted within what was referred to as a machine cycle. FARGO and then RPG were both built to emulate the actions of this machine cycle. The electromechanical cycle was to be basically replaced by the new notion of an electronic program cycle. RPG I was superior to RPG 0 and less buggy, and so it rapidly replaced FARGO as the “report generator program” that businesses would choose to implement computer applications that had previously been control panel, cycle-oriented.

To this day, RPG is a programming language for business applications. Originally, IBM named it Report Program Generator and so the initials flowed from the words. Eventually, even IBM did not believe the initials meant anything anymore. Yet, the language under the RPG initials continued to have that magic power to both turn a report with minimal effort and provide logical and computational constructs enabling it to do even more.

Arguing about programming languages is like arguing about religion. Any outsider taking a look at the RPG IV specification of today and comparing it to any other language that exists, including COBOL, and the great PL/1, would conclude that RPG is both more rich and easier to use for business.

The really good function “namers” at IBM have been afraid to change its name to match its function even as that function eclipsed most, if not all, other programming languages. Perhaps to ensure revenue flow from existing customers, IBM persisted with a name, RPG, that only existing customers find appealing. Can you imagine if IBM wanted to make a universal language out of the RPG IV of today? The only missing ingredient is the marketing; the function is world class.

In reflecting, it is amazing that such a phenomenally powerful and fully functional language in the form of RPG IV today had its origins in those old 1920s tabulator control panels and their inherent machine cycles. Nobody was thinking RPG IV when computers had not yet permeated office space. Both FARGO (RPG 0) and RPG were built to mimic the operations of the machine cycle. If you were learning RPG in the early days, for example, the relationship between the electromechanical and the electronic generations would be crystal clear. Even the training manuals back then showed the control panel’s relationship to the programming language coding. It is amazing that the language still exists but even more amazing is how far it has evolved.

There are still some RPG purists who think that the beauty of the cycle should have been preserved so that RPG would continue to be a great report writing facility while it concurrently became a great programming language. The irony in this statement is that it has been preserved. No kidding! RPG IV supports primary and secondary files which deliver to the programmer the full RPG cycle.

If IBM published the original RPG specs rewritten for RPG IV and called this baby a 4GL query language, many in the know would not argue the point. IBM does not highlight the fact that the old capabilities of RPG are about as good a list of facilities for a modern query language as ever developed for those who want just a little more than query. It’s not a bad macro language either. If only. . .

So, what happened after RPG I? How did it become what it is RPG? This language is still used on mainframes (in its older form) and as some in the non IBM i world would say, it is also used on minicomputers (that’s the IBM i operating system on Power iron) today. But the language has far more facility than the early days.

As computer systems evolved, so did computer languages. RPG 0 became RPG I and ran on 1401 machines. With the introduction of the System/360 in the mid 1960s, IBM brought RPG to its baby System/360 unit, the Model 20. Then later, RPG was built to run on the IBM Rochester built 96-column card unit-record replacement computer, known to those in AS/400 Land as the System/3.

The System/3 version of the language was introduced as RPG II because IBM had no other excuse for putting operations inside of the logic flow of what had previously been just mechanical cycle emulation. RPG II therefore was the grand separator of the electromechanical from computer-driven languages. The RPG II language on the primarily batch System/3 units permitted programmers who loved the cycle to do things easier than with control panels and easier than with Fortran or assembler, and it permitted those who did not like the cycle to avoid it and do even more.

When the System/32 and the System/34 emerged, they too used what was called the RPG II language, but IBM had taken the language to an even higher level. So, let’s call this RPG II and a half. As a point of note, IBM’s mainframes still have not moved to RPG II and a half.

In 1977, with its System/34, IBM introduced native display station (terminal) operations. On mainframes, this function was added via special subroutines and never became part of the RPG, COBOL, or PL/I languages on those systems. The subroutines and the underlying monitor that supported them on mainframes was known as CICS. Processing data from a terminal as if it were a real device was nothing that the 1969-based RPG II batch programming language could even think of doing. Instead, it used the same methods as adopted by the mainframes with a mechanism called the Communication Control Program.

The System/34 and later the System/36 did not need CICS or CCP functionality as the compiler writers had perfected the use of a terminal as a natural device for the RPG II and a half compiler. RPG II and a half reigned supreme until IBM announced the System/38, but ironically RPG II and a half still exists today in many small and large RPG shops as the IBM i OS still supports a facility dubbed the System/36 environment.

In 1978, IBM upped its RPG ante with the introduction of device independent data management and a whole host of facilities that intrinsically became part of the next major RPG language name change. The RPG III language included native relational database operations, native telecommunications operations, and a full separation of the display (user interface) and the program (logic). This later capability called the display file was well ahead of its time as just like today’s Web programs require logic and user interface separation. The System/38 in 1978 with RPG III invented this idea.

At the time, many thought the functions were so rich in RPG III that a new name for the language would be forthcoming. But, that was 1978 and the name is still RPG. Quite frankly, this one puzzles me. One part of me thinks IBM chose to keep the name the same to protect the revenue stream but then again, almost everybody who bought a System/38 bought RPG. Some also bought COBOL. Maybe it did not matter from a marketing perspective as IBM did not plan to release the language outside of the System/38 architecture.

In 1988, IBM combined the power of the System/36 with the power of the System/38 and its new RPG package could produce System/36 type RPG II and a half applications, System/38 type RPG III applications, as well as something called native AS/400 RPG/400 applications.

At the time of its introduction with the original AS/400s, the programming community did not notice many enhancements but they came as time passed. The biggie was that three RPGs were shipped with the same compiler package and all ran on the one 1988 vintage AS/400 machine and this has continued unstopped in all subsequent heritage machines, as well as the new Power Systems. RPG IV was announced in 1994 and there are still some programmers (in fact if the truth be known there are many) who still do not use all of the facilities announced with the RPG IV language. Initially, there were some specification changes and limits raised so that larger field and file names could be used and the decades-old coding form was revamped with a number of form types eliminated and replaced with a new “data” spec and keyword language options.

Clearly RPG IV is a better language than RPG/400 for programmers from all venues. However, it is different from what the original RPG constituency was anticipating and so it took awhile to be adopted. Many who use RPG IV today do not use all of the phenomenally powerful functions embedded in this language. But, perhaps that is true of all programming languages and all programmers.

The three biggest notable items added to the RPG IV language since its inception are: built-in functions, procedures, and free form operations. If IBM were to introduce this language to the worldwide programming community at large by making it available on more platforms, it would clearly be a programming language “game-over” statement.

A brief history of the ibm rpg programming language 1

The most amazing thing about RPG is that it still can be used for simple operations. Yet it can also perform at the sublime levels so far ahead of the current pack that no real computer nerds or eggheads who were honest with themselves could ever conclude that there is any reason why it is not the best computer language ever developed for everything.

Those who have seen the things I have written about the AS/400 heritage machines and the IBM languages know I wish fervently for IBM to release RPG IV to the whole world on all systems and make it a fully enabled Web programming language.

Why IBM, the caretaker of this language, as Sun Microsystems is for Java, continues to keep it hidden and not fully Web-capable is a mystery to many in the programming world. When IBM finally hires a marketing guy to run the company this may change–so there is hope. And, how about at the same time we have a real name change for RPG, such as the IBM Business Language? According to IBM, the letters RPG mean absolutely nothing. So, let’s get rid of them!

Brian Kelly is an assistant professor in the Business Information Technology program at Marywood University, where he also serves as the System i technical advisor to the IT faculty. Kelly has developed and taught a number of college courses in the IT and business areas. He has an active consultancy in the information technology field, Kelly Consulting. He is the author of dozens of books, has written numerous articles about current IT topics, and is a frequent speaker at COMMON and other technical conferences and user group meetings across the United States.

  • Thanks for this article. I’m start programming RPG since 1978 on S/3 systems and still using it some times over i5. I’d used a lot of time the template of the picture (O specs) and the others too (HFELIC). Very nice times for me. Thanks a lot.

  • {"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}

    Join the IBM i Community for FREE Presentations, Lessons, Hints and Tips