Hello. Does anyone know how I can load multiple subfile records in an EDTFIL for a single DB record read? I have looked through all PGM context fields and BIF's but I do not see anything that can accomplish this.
Hi Rick, good to hear from you as well!
No, you cannot build an EDTFIL/DSPFIL over an array directly. But there have been methods described over the years where you load data from an array into a DSPFIL. It generally requires a file that has one record in it, that is used to cause the load processing to loop (using SETLL to reposition after each array read in Initialize Subfile Record) until the array is completely processed.
I think you have probably come up with the best solution, given what you have. Rewriting to use arrays might not reap any rewards...
An EDTFIL is going to want to deal with the Primary Keys for the record being edited. So loading 2 records into the subfile is going to lead to issues unless both loaded records have all the file data, and you're keeping them in sync.
What is it that you are trying to do?
Generally, for things where the standard 2E functions don't lend to the desired result, I aim for the use of arrays and use a DSPFIL that handles the db maintenance. But I am still a bit lost on why you would need 2 different subfile records for one DB record...
Hi Crispin. Nice to hear from you again! I have come up with an approach in which I would build a work file using unique keys of the fields in the error string, load the work file, then build the EDTFIL over that. However, I would rather use *Arrays as you suggested. However, you are not able to build a DSPFIL or EDTFIL over an Array file, are you?
Here is the scenario. This happens during 'Initialize subfile record' user point.
The issue we have now come across is it is possible to have more than one field in the string with the same reject code. SO in that case, we want to display both fields on the screen for the same reject code master record.
I have a file with one field per load with 100 records have the index in the field. then you can build a DSP over that file and then access the array
in Initialize subfile record from DBF record.
Retrieving data ...