IBM i e-Book
A Developer’s Guide to Mastering IBM i Concepts
IBM i Index
Report Program Generator (RPG)
Expandable Subfile
Index
- Introduction
- Example
- Usage of Expanding Subfile
- Restrictions of Expanding Subfile
Introduction
Expandable Subfile is also referred to as an elastic or growing subfile because of its increasing nature. Unlike Load all subfiles where all 9999 records are loaded into the buffer in a single shot, the expandable subfiles load data into the buffer one page at a time.
Since data will be loaded into buffer only upon PAGEDOWN, this case needs to be handled. PAGEUP will be automatically handled by the system since data is already loaded into the buffer.
The basic ask for an Expandable Subfile while defining the DDS source is for the SFLSIZ to be at least one higher than the SFLPAG. The subfile buffer’s SFLSIZ is expanded to hold all records up to the buffer limit of 9999.
Example
Display File: CUSTDSPF
Main Program: CUSTMAIN
Output:
Uses of Expandable subfile
- When you want to show a lot of records but are unsure of the exact size ahead of time, expandable subfiles can be helpful.
- When showing client transactions, inventory goods, or staff data are among the situations where the quantity of records can differ greatly, they are frequently used.
- Always keep in mind that expandable subfiles are a useful tool for managing dynamic data in AS/400 programs because they offer flexibility and adaptability.
Restriction of Expandable Subfile
Performance: Due to the AS/400 system’s limited processing power and memory, expandable subfiles may experience performance problems with bigger datasets, even though they are effective for smaller datasets.