A key option allows you to select records based in part on the data in the records
<key>
── KEY ─┬─────────────┬─<start position>─┬─ EQL ─┬──<search argument>──┤ ├─ CHARACTER ─┤ ├─ GTR ─┤ ├─ BYTE ──────┤ ├─ GEQ ─┤ └─ DIGIT ─────┘ ├─ LEQ ─┤ ├─ LSS ─┤ ├─ NEQ ─┤ ├─ = ───┤ ├─ > ───┤ ├─ >= ──┤ ├─ <= ──┤ └─ < ───┘
──┬─ " ──<alphanumeric>── " ─┬─────────────────────────────────────────┤ └─ @ ──<hexadecimal>── @ ──┘
Explanation
Identifies the starting position within a record that is used for comparison. CHARACTER is the default. BYTE is a synonym for CHARACTER. DIGIT specifies that the position is given in 4-bit digit positions. The first position in the record is position zero (0).
Specifies the criterion to be used for comparison. The maximum length of the search argument is 20 bytes or 40 hex digits. A hexadecimal string must be specified if DIGIT was used to specify the <start position>. If DIGIT was not used with the <start position>, and a hexadecimal string is given as the <search argument>, the actual digit position used is twice the <start position> value (one byte = two digits).
Example 1
To select all records with the word “system” in the first 6 characters use:
KEY 0 = SYSTEM
Example 2
To select all records with a number greater than 7 in position 71 use:
KEY 71 GTR 7