Wednesday, September 19, 2007

Overview and History of RPG


Overview


RPG (and RPG IV and RPGLE) is the mainstay programming language of the IBM iSeries platform. Originally designed as a query tool, IBM has enhanced the language to become a full-fledged, powerful programming language.

An RPG program typically starts off with a File Specification, listing all files being written to, read from or updated, followed by a Data Definition Specification containing program elements such as Data Structures and dimensional arrays (much like a "Working-Storage" section of a COBOL program or var statements in a C program). This is followed by the Calculation Specification, which contains the actual meat of the code. Output Specifications can follow which can be used to determine the layout of a report or the report can be defined externally.

In the early days of RPG, its major strength was known as the program cycle: every RPG program executes within an implied loop, which can apply the program to every record of a file. Alternately, the cycle can make an interactive program continue to run until explicitly stopped. Today, most RPG programmers avoid using the cycle in favor of controlling the flow of the program with standard looping constructs.

-------------------------------------------------------------------------------------

History




RPG is one of the few languages created for punch card machines that is still in common use today. This is because the language has evolved considerably over time. It was originally developed by IBM in the 1960s and ran on the popular IBM 1401. Originally, RPG was an acronym for Report Program Generator, descriptive of the purpose of the language: generation of reports from data files, including matching record and sub-total reports.


The alternative languages generally available at the time were either COBOL or BASIC: one verbose, the other a poor tool for development, so RPG became pre-eminent on IBM hardware.


RPG was further developed by IBM for their range of mainframe systems, especially the S/360 - as RPG II.


Because the language syntax was based on the plug-boards used to program unit record equipment, and the System/3 was initially developed as a successor to plug-board programmable unit record machines, RPG II was ported to the System/3, System/32, System/34, and System/36, while an improved version of the language, RPG III, was created for the System/38 and its successor the AS/400 (a mid-range machine, now evolved into the eServer iSeries) and became RPG/400 with a much cleaner syntax, and tighter integration with the integrated database. This language became the mainstay of development on the AS/400, and its editor was a simple line editor with prompt templates for each specification (type of instruction).


RPG III significantly departed from the original language, providing modern structured constructs like IF-ENDIF blocks, DO loops, and subroutines.


In 1994, RPG IV (aka RPGLE aka RPG/ILE) was released and the name, officially, was no longer an acronym. RPG IV offered a greater variety of expressions within its new Extended Factor-2 Calculation Specification.


In 2001, with the release of OS/400 V5R1, RPG IV offered even greater freedom for calculations than offered by the Extended Factor-2 Calculation Specification: a free-format text-capable source entry, as an alternative to the original column-dependent source format. The "/FREE" calculation does not require the operation code to be placed in a particular column; the operation code is optional for the EVAL and CALLP operations; and syntax generally more closely resembles that of mainstream, general-purpose programming languages.


Today, RPG IV is a considerably more robust language. Editing can still be done via the simple editor or it can edited via PC using IBM's Websphere Development Studio. IBM is continually extending its capabilities and adding more built-in functions (BIFs). It has the ability to link to Java objects (See IBM's RPG Reference Manual ), and OS/400 APIs; it can be used to write CGI programs with the help of IBM's free Cgidev2 web toolkit or other commercial packages. And yet, it retains a great deal of backward compatibility. So an RPG program written 20 years ago could run today with little or no modification

Retrieved from "http://csiwiki/index.php?title=Overview_and_History_of_RPG"

No comments:

Post a Comment