Back to: ILE RPG in Easy Bytes

Unit 16 extends your ability to write interactive list-style applications by introducing you to the concept of subfiles. It shows you how to define a subfile by using DDS, and how to use any of three methods for processing the subfile with an RPG program.
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: 15. Interactive Programs – 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.
Programming with Subfiles
You learned how to write inquiry and maintenance programs whose logic required the display of information one record at a time. Some kinds of applications require the use of list panels, in which data from many records is displayed on a screen for review, selection, or update. RPG has a special feature called subfiles to handle this type of program requirement.
Programmers use several different approaches to defining this interrelationship and to loading data into the subfile. The method used depends in part on a program’s anticipated processing requirements: Loading the subfile a page at a time SFLSIZ greater than SFLPAG SFLSIZ equal to SFLPAG Loading the entire subfile When the program loads the subfile a page at a time, each page loads rapidly because the program does not have to read all the records in the file to initially build the list.
Response time is consistent, regardless of the number of records viewed. With this method, the subfile stores only one page of records at a time. Scrolling forward requires replacing the existing page with the next page to be loaded; scrolling backward requires replacing the existing page by reloading the previous page.
Although this method is the easiest to code, it results in the slowest initial response time. Once display begins, however, paging through the subfile is fast because the system handles all paging functions. Using this technique is appropriate when the entire list is relatively small, especially if users may want to see most of the list; it is least appropriate when a large number of records must be loaded and users are unlikely to want to see most of those records.
- Before starting this course you must complete the required prerequisite course: 15. Interactive Programs – ILE RPG in Easy Bytes