Back to: ILE RPG in Easy Bytes

Unit 4 focuses on program design, and introduces you to ILE RPG operations that let you write well-designed programs by using a top-down, structured approach. Loops, decision logic, and subroutines receive special attention. This unit applies these design principles by teaching you how to code solutions to control break problems.
This course is a unit of the ILE RPG in Easy Bytes series, a complete introductory ILE RPG programming self-guided tutorial.
- Before starting this course you must complete the required prerequisite course: 3. Declarations – ILE RPG in Easy Bytes
One-Time Payment
Members Only
Instead of paying for each unit individually, you may purchase a membership which will automatically enroll you at a discount in the entire “ILE RPG in Easy Bytes” series.
Controlling Program Workflow
Although an important goal, correct output should not be the programmer’s only goal. Producing code that is readable and easy to change is also important to programmers who are concerned with quality. Changes in user requirements and processing errors discovered as programs are used dictate that programmers spend a lot of their time maintaining existing programs rather than developing new code.
First, we illustrate the options for sending control to alternative statements within a program: selection (decision) operations. If RPG’s primary decision operator is If.
Iteration lets your program repeat a series of instructions—a common necessity in programming. In batch processing, for example, you want to execute a series of instructions repeatedly, once for every record in a transaction file. Previous lessons have already used one ILE RPG operation that enables iteration, or looping:
A second design concept, top-down methodology, usually works together with a structured approach. Top-down design means developing your program solution starting with a broad outline and then successively dividing the big pieces into smaller and smaller units. This technique is sometimes called hierarchical decomposition.
generating a report that includes subtotals. Assume you have a file of sales records. Each record contains a salesperson’s identification number, department, the amount of a specific sale, and the date of the sale.
Because these operations all involve expressions, the Extended-Factor 2 format is appropriate: *.. 1 …
- Before starting this course you must complete the required prerequisite course: 3. Declarations – ILE RPG in Easy Bytes