Key fields having the same key position should not be compared under two conditions.
To avoid unwanted comparisons between key fields, specify *NONE in place of one of them and move the displaced key field to the next key position. The operating system compares the values of key positions before and after *NONE, but retrieves the affected records in the order in which the record formats are specified in the DDS for the logical file.
You can specify *NONE two or more times on the following lines to displace a key field to a key position for which a comparison of key field attributes is relevant to your application.
Figure 1 shows *NONE as the key field.
|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8 A R RECORD1 PFILE(PF1) A FIELD1 6A A FIELD2 4A A FIELD3 10A A K FIELD1 A K FIELD2 A K FIELD3 A A R RECORD2 PFILE(PF2) A FLD1 3A A FLD2 4A A FLD3 12A A K *NONE A K FLD2 A A R RECORD3 PFILE(PF3) A F1 6A A F2 4A A F3 10A A K F1 A K F2 A K F3 A
In Figure 1, the attributes for FIELD2, FLD2, and F2, must be identical. Because you specified *NONE for the first key field of the second record, then FIELD1 and F1 (first key field of the first record and first key field of the third record) must have identical attributes. FIELD3 and F3 must also have identical attributes; there is no corresponding field in the second record format.