Selection rules and example

Selection rules:
  1. 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.
  2. 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.
  3. 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.

Figure 1. TABL format display without redefines criteria
  Process   Options   Help                                                      
 ───────────────────────────────────────────────────────────────────────────────
 View             FMN.PI97117.DATA(TESTR)                           Top of 3    
 Command ===> _____________________________________________________ Scroll CSR  
                                                  Record AT TOP     Format TABL 
         REDEF-TYPE DATA-A1 DATA-A2 DATA-B1 DATA-B2 DATA-C1 DATA-C2             
         #2         #4      #5           #7      #8     #10     #11             
         AN 1:1     AN 2:2  AN 4:2   ZD 2:2  ZD 4:2  BI 2:2  BI 4:2             
         -          <>      <>          <->     <->  <---+>  <---+>             
 ******* ****  Top of data  ****                                                
 0000001 A          A1      A2          ***     ***  -15887  -15886             
 0000002 B          01      02            1       2   -3855   -3854             
 0000003 C          ..      ..          ***     ***       1       2             
 ******* ****  End of data  ****                                                

Viewing this data with the redefines criteria as illustrated in previous examples in TABL mode results in the following display.

Figure 2. TABL format display with redefines criteria
  Process   Options   Help                                                      
 ───────────────────────────────────────────────────────────────────────────────
 View             FMN.PI97117.DATA(TESTR)                           Top of 3    
 Command ===> _____________________________________________________ Scroll CSR  
                                                  Record AT TOP     Format TABL 
         REDEF-TYPE DATA-A1 DATA-A2 DATA-B1 DATA-B2 DATA-C1 DATA-C2             
         #2         #4      #5           #7      #8     #10     #11             
         AN 1:1     AN 2:2  AN 4:2   ZD 2:2  ZD 4:2  BI 2:2  BI 4:2             
         -          <>      <>          <->     <->  <---+>  <---+>             
 ******* ****  Top of data  ****                                                
 0000001 A          A1      A2                                                  
 0000002 B                                1       2                             
 0000003 C                                                1       2             
 ******* ****  End of data  ****                                                
                                                                                

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.

Figure 3. SNGL format display without redefines criteria
  Process   Options   Help 
 ───────────────────────────────────────────────────────────────────────────────
 View             FMN.SAMPLE.DATA(TESTR)                          Rec 1 of 3 
 Command ===> _____________________________________________________ Scroll CSR  
                                                  Record 1          Format SNGL 
                                                      Top Line is 1    of 7 
 Current 01: REDEFINES-LAYOUT                                     Length 5      
 Field               Data  
 REDEF-TYPE          A     
 DATA-A1             A1    
 DATA-A2             A2    
 DATA-B1             ***   
 DATA-B2             ***   
 DATA-C1             -15887
 DATA-C2             -15886
 ***  End of record  *** 
Figure 4. SNGL format display with redefines criteria
  Process   Options   Help 
 ───────────────────────────────────────────────────────────────────────────────
 View             FMN.SAMPLE.DATA(TESTR)                          Rec 1 of 3 
 Command ===> _____________________________________________________ Scroll CSR  
                                                  Record 1          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              A
   3  2 DATA-A
   4   3 DATA-A1                A1
   5   3 DATA-A2                A2
 ***  End of record  ***

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.