RPG IV - Chapter 1

Download Report

Transcript RPG IV - Chapter 1

RPG IV
Introduction to Programming and RPG Chapter 1
Objectives:
Describe the history of RPG
Describe program variables
Describe the types of data files
Describe data hierarchy
Explain how data is represented on the
printer spacing chart
Describe the program development
cycle
History of RPG
1960: RPG - Report Program Generator
Late 1960s: RPG II - With release of
System/3
1979: RPG III - Interactive program,
Database, Structured Programming
1988: RPG/400 - Upgrade to RPG III
1994: RPG IV - Integrated Language
Environment (ILE)
Program Variables
Program variable represents a location
in the memory of the computer that can
store data.
RPG uses the term field rather than
variable.
Define name, length and data type
Data Files
Transaction files
Master files
Data Hierarchy
FILE: is a collection of data about a
given kind of entity or object
RECORD: is a collection of data about
one specific instance of the entity
FIELD: is one piece of data on the
record. A field generally represents the
smallest unit of data that we want to
manipulate within a program.
Programming Specifications
Record Layouts - input
Processing required - process
Printer Spacing Charts - output
Programming Specifications
PSC Notation
Meaning
-----------------------------------------------------------------------------------------------------------$XXXX.XX
Fixed dollar sign, no zero suppression, no comma.
$X,XX0.XX
Fixed dollar sign, zero-suppress to unit's place, insert
commas.
$X,XX$.XX
Floating dollar sign, zero-suppress to unit's place, insert
commas.
XX0
No dollar sign or decimal; complete zero suppression.
XXX
No sign to be displayed.
-XX0
Fixed sign, complete zero suppression.
-XX-.XX
Floating sign, zero-suppress to unit's place.
XX0.XX-
Zero-suppress, trailing negative sign.
XX0.XXCR
Zero-suppress, indicate negative value with CR.
Program Development Cycle
Define the problem
Design the solution
Write the program
Enter the program
Test and debug the program
Document the program
Maintain the program
Program Entry and Testing
Points to Remember
RPG is a high-level programming
language introduced by IBM in the
early 1960s to provide an easy way to
produce commonly needed business
reports.
Variables enable programs to process
different sets of data.
Data is typically organized in a
hierarchy of files, records, and fields.