RPG is a "program generator" and not a language. My first mentor stressed that to me so often, I couldn't start writing anything about RPG without saying that. He was such an advocate of RPG over other programming languages, he insisted that the appeal and power of RPG was that it was not a complex programming language. It was a tool that could be quickly and simply used to create solutions to business needs without getting caught up in language syntax and internal mechanics.
However, in spite of my mentor's adamant statement to the contrary, RPG is a programming language with all the requisite syntax, structure, and rules that accompany any programming language. RPG was designed to appeal to that set of people who were familiar with punched card accounting equipment - collators, reproducing punches, accounting machines. These machines were "programmed" using wires and plug boards. Data was input with punched cards. The extremely simple "programs" that could be devised for these machines could read a series of cards, collated with information related to a single entity (a student for example) in a group of cards, and produce a simple report from the information. Much of the terminology in RPG relates to this origin in punched card methodologies - indicator "switches", matching records, and control levels, for example.
These accounting machines achieved their results by very mechanical means. The plugs and wires used to "program" them conveyed electrical charges originating from reading data from punched cards to specific control points in a physical cycle. The functioning of an RPG program is also related to a fixed processing cycle. An individual RPG program effects calculations and produces output by turning indicators on or off. The basic logic of all RPG programs is essentially identical and is defined by the RPG Logic Flow.
So RPG is a simple language with only a few different types of input statements. However, it can be used to produce very complex programs which do much more than simply produce reports.
This page was last updated on January 17, 2015 .