Previous Topic: *Re-Read Subfile Record

Next Topic: *Synon Work field (15,0) to (17,9)

Differences in Subfile Processing Between EDTTRN and DSPTRNs Compared to DSPFIL, EDTFIL, and SELRCDs

The EDTTRN and DSPTRN functions load all records in a subfile before the panel appears. They also re-process all records in the subfile when the user requests validation of the data.

In the example described under PGM *Cursor field, this means that the CASE statement is tested for every subfile record and is able to determine the exact subfile record and field on which the cursor is currently positioned.

The DSPFIL, EDTFIL, and SELRCD functions load records one page at a time.

They only re-process records that have been modified or touched by the end user. This processing enables these functions to perform efficiently and ensures that records that have not been modified are not processed. This means that the USER: Process Subfile Record (or equivalent user point) is examined for EDTTRN and DSPTRN functions for every record in the subfile.

Since DSPFIL, EDTFIL, and SELRCD functions only process changed records, the CASE statement is only tested for those records that have been flagged as modified.

In order for the cursor position to be detected on subfile records in these function types, you must change the subfile record or you must flag the subfile record to be re-read in any event.

To achieve the latter, another field PGM *Re-read subfile record can be used.

To ensure that subfile records are re-processed, the PGM *Re-read Subfile Record field should be set to *Yes as follows:

PGM.*Re-read Subfile Record = CND.*YES

<--QUIT

If the DSPFIL had no post-confirm pass, the following additional action diagram logic would be required at the end of User: Process Subfile Record (pre-confirm) user point. This would ensure that the subfile records are re-processed again if the subfile was re-loaded after the processing pass of the records.

You can condition the setting of *Reread Subfile record based on a set of conditions. This could be used to pre-select records that meet certain status criteria.

For example:

> USER: Process subfile record (Pre-confirm)

.-- :.—CASE :|-RCD.Order value is GT CTL.Customer Max Order Value :| PGM.*Re-read subfile record = CND.*No :| Send information message - Order & 1 will not be accepted :|-*OTHERWISE :| WRK.Highlight field = CND.*YES Order Value :’—ENDCASE ‘--