Introduction to Programming and RPG Chapter 1 Presentation

  • Slides: 11
Download presentation
Introduction to Programming and RPG Chapter 1 Presentation © Copyright 2002, Bryan Meyers

Introduction to Programming and RPG Chapter 1 Presentation © Copyright 2002, Bryan Meyers

Objectives • • • Describe the history of RPG Describe program variables Describe the

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 Programming in RPG IV Third Edition 2

History of RPG • Early 1960 s: RPG - Report Program Generator • Late

History of RPG • Early 1960 s: RPG - Report Program Generator • Late 1960 s: RPG II – With release of System/3 • 1979: RPG III – Interactive programming – Database – Structured Programming • 1988: RPG/400 – Upgrade to RPG III • 1994: RPG IV – Integrated Language Environment (ILE) – Modular Programming in RPG IV Third Edition 3

Program Variables • Program variable: a location in the memory of the computer that

Program Variables • Program variable: a location in the memory of the computer that can store data • RPG commonly uses the term field rather than variable • All variables used in a program must be defined – Name – Length – Data type Programming in RPG IV Third Edition 4

Data Files • Transaction files – Contain information about day-to-day business occurrences • Master

Data Files • Transaction files – Contain information about day-to-day business occurrences • Master files – Contain definitive information about customers, products, etc. Programming in RPG IV Third Edition 5

Data Hierarchy • File – Collection of data about a given kind of entity

Data Hierarchy • File – Collection of data about a given kind of entity or object – Record – Collection of data about one specific instance of the entity • Field – One piece of data on the record – Generally represents the smallest unit of data that we want to manipulate within a program. Programming in RPG IV Third Edition 6

Programming Specifications • Record Layouts – Input • Processing required – Process • Printer

Programming Specifications • Record Layouts – Input • Processing required – Process • Printer Spacing Charts – Output Programming in RPG IV Third Edition 7

Printer Spacing Charts PSC Notation Meaning $XXXX. XX Fixed dollar sign, no zero suppression,

Printer Spacing Charts PSC Notation Meaning $XXXX. XX Fixed dollar sign, no zero suppression, no comma $X, XX 0. 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 XX 0 No currency symbol, complete zero-suppression XXX No sign diplayed -XX 0 Fixed sign, complete zero suppression -XX-. XX Floating sign, zero suppress to unit’s place XX 0. XX- Trailing sign, zero-supress XX 0. XXCR “CR” for negative value, zero-suppress Programming in RPG IV Third Edition 8

Program Development Cycle • • Define the problem Design the solution Write the program

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 Programming in RPG IV Third Edition 9

Program Entry and Testing Start Enter/edit Source Compile Program Syntax Errors? Yes Bind Program

Program Entry and Testing Start Enter/edit Source Compile Program Syntax Errors? Yes Bind Program Run Program Yes Logic Errors? Stop Programming in RPG IV Third Edition 10

Points to Remember • RPG is a high-level programming language introduced by IBM in

Points to Remember • RPG is a high-level programming language introduced by IBM in the early 1960 s 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 Programming in RPG IV Third Edition 11