IBM RPG II
IBM RPG II
Main page

IBM RPG II

logo
Community Hub0 subscribers
What are your thoughts?
Be the first to start a discussion here.
Be the first to start a discussion here.
IBM RPG II

RPG II is a very early and popular version of the IBM RPG programming language.

It was developed in the late 1960s and designed to work on the smallest IBM systems of the time such as the IBM 1130, IBM System/3, System/32, System/34, System/36. It was also available for the System/370, The Singer System 10, Sperry Univac 90/25, 90/30, 90/40, System 80, 1100 mainframe series and the Wang VS Series. ICL produced versions for its ICL 2903 system and for VME/K; and Burroughs Corporation produced an RPG II compiler with database extensions for its B1700 series of computers. Digital Equipment Corporation had their own implementation named VAX RPG II for VAX/VMS systems.

An enhanced version RPG III appeared in 1978.

It has a number of unusual features, including: an implied processing loop; and that it is a fixed-format programming language, so that programs are difficult to read without a special debugging template.

RPG II is a fixed-format programming language, which means that code must be placed in exact column locations in order to generate correct results. There are eight different specification types, and separate coding forms are used to write each, and a special debugging template used as an aid to read program printouts.

Every RPG II program executes within an implied loop, the program cycle, which applies the program successively to every record of a file - this is documented via a "Logic Flow" diagram on the debugging template. Each record (individual punched 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" — from a set of logical variables numbered 01–99 for user-defined purposes, or other smaller sets based upon record, field, or report processing functions. Special variables such as UDATE, UYEAR, PAGE, and so forth, are filled when the program begins or when page overflow occurs, even though there is no explicit instruction for these activities. Total calculations and output are done at "total time," after the detail cycle when L1/LR has been set on by fixed logic.

The concept of RPG's program cycle fitted neatly with a cyclical machine that read cards, summarised their contents and prints a result, rather like a tabulating machine. The language was extended to handle other input and output devices and provides a fast and efficient method of programming.

Devices such as the workstation (WORKSTN), the keyboard (KEYBORD), or the console (CONSOLE) do not have a fixed number of records at the beginning of the job and therefore, in order to incorporate the fixed-logic RPG "Last Record" cycle, the LR indicator can be set on with a SETON instruction. LR cannot be set off.

See all
User Avatar
No comments yet.