Ch 1. Introduction to RPG [ HP RPG/iX Reference Manual ] MPE/iX 5.0 Documentation
HP RPG/iX Reference Manual
Chapter 1 Introduction to RPG
The HP Report Program Generator (RPG) language is a machine-independent,
task-oriented language that enables you to easily create programs that
print reports, update files, and perform many other general file
functions. RPG is available on non-HP computers and programs running on
these computers require little or no conversion to run on HP 3000 Series
900 computers. For information on converting RPG programs that run on
non-HP computers or that run under the MPE V operating system, see
Appendix A of the HP RPG Programmer's Guide.
RPG is used frequently in business and commercial applications. You can
use RPG to print mailing labels. It can also be used to compute complex
payrolls including the printing of paychecks, payroll registers, and
other payroll reports. RPG is also ideal for producing inventory lists,
invoices, insurance benefit notices, customer transactions, and summaries
of sales and losses. In addition to printing reports, you can use RPG to
update the files from which the reports are produced.
In summary, you can use RPG programs to:
* Process large tables and arrays of data.
* Process data stored on several types of devices.
* Perform extensive calculations and save the results on disk or
tape, or display them on a terminal.
* Update large disk files and databases.
* Generate several reports of varying complexity in a single
program.
* Process records randomly or sequentially using the the Keyed
Sequential Access Method (KSAM) or TurboIMAGE subsystems.
RPG programs differ from programs written in other languages. You do not
decide the main logic of the program. Your source statements,
specifications, are executed in a pre-determined order. This is called
the RPG logic cycle. Take, for example, a payroll program that reads
employee hours-worked, then computes pay for the period. The logic cycle
reads the first employee's hours, and executes the specifications that
compute earnings, deductions, and withholdings. It then prints the
employee's paycheck and reads the next employee's hours. This sequence
is repeated until the last employee's hours are processed. To
effectively use RPG, you should understand what actions are performed
during each phase of the logic cycle.
This manual devotes a separate chapter to each of the seven types of
specifications. See the HP RPG Programmer's Guide for a complete
discussion of the RPG logic cycle.
MPE/iX 5.0 Documentation