What's the difference between the three types of subfiles in the DDS, as well as the difference in programming...
the three. Also, how is one more advantageous over the other with respect to the OS/400, as well as the program?
Rather than go into a long and involved explanation here, I will point you to a number of articles on the subject by Kevin Vandever:
Back to Basics: Introduction to Subfiles: This is a basic introduction to subfiles in RPG, with an example of a LOAD ALL subfile.
Back to Basics -- Self-Extending Subfiles: This converts the LOAD ALL subfile to a SELF EXTENDING subfile.
Become the Master of Your Subfile Domain: This completes the trilogy with the page-at-a-time or single-page subfile.
Additional articles which will be of interest to anyone doing subfiles are:
Back to Basics: Multiple Subfiles on One Screen: This covers multiple LOAD ALL subfiles on a screen.
Back to Basics: Side-by-Side Subfiles: This covers 'side-by-side' subfiles (!)
Back to Basics: Modifying a Subfile: This shows how to let the user add and update database data from a subfile.
Back to Basics: Data Entry Subfiles: This article covers fast data entry using a subfile.
Empower Users with Embedded SQL: This combines embedded SQL with subfiles for a powerful enquiry program All the articles have downloadable code for you to build on. My own advice is to stick with self-extending subfiles unless there is a good reason for going for one of the other techniques. Once you have your code perfect for the technique you will normally use, it is then just a matter of copying code and making slight alterations when you have a new subfile program to write.
Dig Deeper on RPG iSeries programming
Related Q&A from John Blenkinsop
When an error occurs on an IBM command, the diagnostic messages are sent first, then an escape message, which you can monitor. On AS/400 you see the ... Continue Reading
Learn how to 'append data to the file' with the FTP DIR command, and eliminate the hassle of having to end the FTP session and restart to view ... Continue Reading
RPGIV will 'think of' incoming integer fields as binary, and then will redefine them in the program structures as PACKED. So, when you chain a record... Continue Reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.