Write an Expanding Page Size Subfile using RPG on the AS400

  • Home
  • /
  • Blog
  • /
  • Write an Expanding Page Size Subfile using RPG on the AS400

October 10, 2008

Write an Expanding Page Size Subfile using RPG on the AS400

By NickLitten

October 10, 2008

SFLPAG, SFLSIZ, SFLSIZE

Expandable subfiles in RPGLE

An expandable subfile is one in which ideally one page of records are loaded at a time. Subsequent pages are added to the subfile as per the user demand.

In the expandable subfile the subfile size must be at least one greater than the page size.

The ILE RPG program to process an expandable subfile has typically the following flow

1. Load the subfile: Initially the only the first one page of the subfile is loaded.
2. Display the subfile: The subfile screen is displayed to the user.
3. Rollup: Check if user pressed the rollup key. Many a times no rollup is defined and the next page is loaded with ENTER (RETURN) key only. If ROLLUP key has been pressed, load the next page and display it.

Note: In expandable subfiles, we do not need to handle ROLLDOWN. This is handled by the system itself. This is because we do not clear subfile before loading the next page. The next page records are simply added to already existing first page.

Want to see the code?

Write an Expanding Page Size Subfile using RPG on the AS400 1

RPG Programming for Beginners

RPG is the well known programming language on the IBM i platform. Earlier versions of RPG ran on the old AS/400 and iSeries machines in decades gone by… the beauty of RPG is that it is fully backwards compatible. But, over the years RPG has evolved massively!

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}

Join the IBM i Community for FREE Presentations, Lessons, Hints and Tips

>