Problem solve Get help with specific problems with your technologies, process and projects.

Search with expanding SubFile

Is it possible to have a Search with expanding SubFile?
Yes. Go and do it.

Actually, I am assuming you mean to add records that satisfy the search criteria to the expanding subfile. This is a very common requirement. Just code the expanding subfile fill routine and add the search into the loop, with an ITER if the search fails to find a hit in the current record.

Things to think about: On large files, searches can take a long time. Especially if there is no matching data in the record, so the whole file is read.

Also, think about the limit of 9,999 records in a subfile.

Look at filling one page of the subfile (or to end of data), then displaying that. If the user pages the subfile to the NEXT page, then receive control in your program and load that next page, and so on. Rolling to the PREVIOUS page can be handled by the system.

Lastly, do the simplest and fastest and most certain selections first (like date ranges, code matches etc.) and the scan afterwards -- there is no point scanning text in a record if it will only be rejected afterwards because it is not for currency = USD. And use different access paths depending on selections entered - don't read data you KNOW you do not want.


The Best Web Links: tips, tutorials and more.

Ask your programming questions--or help out your peers by answering them--in our live discussion forums.

Ask the Experts yourself: Our application development gurus are waiting to answer your programming questions.

Dig Deeper on iSeries ILE programming

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.