Question on LoadAll Subfile.

Application development
Hi, How to load more than 9999 records in the case of loadall subfile??? And i don't want delete previously loaded records. Thanks, Rama Krishna

Answer Wiki

Thanks. We'll let you know when a new response is added.

Hi Rama

The short answer is you can’t. The maximum size of a subfile is 9,999 records and that’s imposed by the operating system.

The only way to exceed the 9,999 record limit is to use a single page subfile where your program handles the page up and page down. You then need to use a workfile, data queue or user index to store the subfile records and keep track of which record number is top of the page.

That way when your program has to page up you can retrieve records from the work file, etc, and when you page down you can either load new records to both the subfile and work file or retrieve from the work file as appropriate.

If you Google for “single page subfile example” you should find some example code.

All the best


Discuss This Question: 4  Replies

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • BigKat
    I believe I heard that V6R1 removes the 9999 limitation.
    9,460 pointsBadges:
  • bvining
    The maximum in V6R1 remains at 9999 and I really doubt we will ever see that number increase. Page at a time processing is clearly the way to go when working with anything approaching this number of entries.
    7,070 pointsBadges:
  • Sloopy
    I have to ask, why would anyone want to load 9,999 records into a subfile? That's 500 screen pages. Apart from the time taken to load, what user is going to page through 500 pages on-screen? I have been asked about this limit many times, and always there is no good reason for loading so many records at once. Usually, it's a lack of understanding of the varieties of subfile processing, but sometimes it's because the programmer wants to hold the complete database file in the subfile. Again - there is no good reason to do that. Consider allowing the user to filter the database into the subfile by allowing her to enter selection criteria. The selection can be done by embedded SQL or by compare-and-ITER code. This, in combination with a self-extending subfile, will cut down the number of records selected to a manageable figure. Additionally, don't load the subfile immediately on program entry, even if you are loading page by page, but instead allow the user to enter any filter values and then load after ENTER is pressed.
    2,195 pointsBadges:
  • BigKat
    Oh, that's right, the RPG limitations (on things like arrays and such) have been extended to 16 million-something, but this would still be a display processing limitation.
    9,460 pointsBadges:

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.


Share this item with your network: