Plex 2E

 View Only
  • 1.  Loading multiple subfile records for one DB read

    Posted Aug 11, 2015 10:14 AM

    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.

     

    Thank you,

    Rick



  • 2.  Re: Loading multiple subfile records for one DB read

    Posted Aug 11, 2015 11:00 AM

    Hi Rick,

     

    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...

     

    Crispin.



  • 3.  Re: Loading multiple subfile records for one DB read

    Posted Aug 11, 2015 11:18 AM

    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.

     

    • EDTFIL built over a Reject Code master file.
    • Transaction file has reject codes in an error string. We read the Reject Code file and then search the transaction string for the existence of the Reject Code. If found, we get the Reject Description and find the field in error from a field string in the Transaction File. These values are then loaded to the subfile record for the current record read.

    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.

     

    Rick



  • 4.  Re: Loading multiple subfile records for one DB read
    Best Answer

    Posted Aug 11, 2015 03:26 PM

    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...

     

    Crispin.



  • 5.  Re: Loading multiple subfile records for one DB read

    Posted Aug 11, 2015 04:34 PM

    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.

     

    thanks

    John