Selection rules and example
Selection rules:
- The first field (and its children, if it has any) that has redefines criteria that evaluates as true for the current record is selected. All other fields (and their children, if any) that map the same area are not selected.
- In the case where no redefines criteria evaluate as true, the first field (and its children, if it has any) that maps the area and does not have redefines criteria is selected. If there are no fields that map the area without redefines criteria, then no fields are selected.
- Nested redefines criteria are only applicable if the parent redefines criteria evaluates as true. The same selection rules apply for nested redefines.
Example
In the example we provided, consider processing the following
data:
Record 1 AA1A2
Record 2 B0102
Record 3 C.... (X'C300010002')
Viewing this data using a template without redefines criteria in TABL mode results in the following display.
Viewing this data with the redefines criteria as illustrated in previous examples in TABL mode results in the following display.
Only the selected redefines fields are populated in TABL mode. Fields that are not selected are blank and protected.
Note: Changing the REDEF-TYPE value may change the selected fields if the redefine criteria yields a
different result.
Viewing the redefined data in SNGL mode yields the following.
REDEF-TYPE = 'A' results in field DATA-A being selected with its children.
Process Options Help
───────────────────────────────────────────────────────────────────────────────
View FMN.SAMPLE.DATA(TESTR) Rec 2 of 3
Command ===> _____________________________________________________ Scroll CSR
Record 2 Format SNGL
Top Line is 1 of 5
Current 01: REDEFINES-LAYOUT Length 5
Ref Field Data
1 1 REDEFINES-LAYOUT
2 2 REDEF-TYPE B
6 2 DATA-B REDEFINES DATA-A
7 3 DATA-B1 1
8 3 DATA-B2 2
*** End of record ***
REDEF-TYPE = 'B' results in field DATA-B being selected with its children.
Process Options Help
───────────────────────────────────────────────────────────────────────────────
View FMN.SAMPLE.DATA(TESTR) Rec 3 of 3
Command ===> _____________________________________________________ Scroll CSR
Record 3 Format SNGL
Top Line is 1 of 5
Current 01: REDEFINES-LAYOUT Length 5
Ref Field Data
1 1 REDEFINES-LAYOUT
2 2 REDEF-TYPE C
9 2 DATA-C REDEFINES DATA-A
10 3 DATA-C1 1
11 3 DATA-C2 2
*** End of record ***
REDEF-TYPE = 'C' results in field DATA-C being selected with its children.