Excluding records

You can limit the records affected by the FIND, CHANGE and DELETE commands, first by excluding some records from display, then by limiting those commands to affecting only the not-excluded records, or only the excluded records.

To exclude individual records on an ad hoc basis, choose one of the following methods:

  • Enter X in the prefix command area of the record to be excluded.
  • Enter Xn in the prefix command area of the first record of n records to be excluded.
  • Enter XX in the prefix command area of the first record of a block of records to be excluded, then enter XX in the last record to be included in the block.

To exclude multiple records based on a common factor:

  • Enter EXCLUDE with the relevant parameters on the Command line (see EXCLUDE/XX primary command).
    For example, the following command excludes all records with an “h” or “H” in column 3:
    EXCLUDE ALL H 3

EXCLUDE commands are cumulative; each successive EXCLUDE command increases the number of records already excluded.

To “unexclude” (redisplay) excluded records, choose one of the following methods:

  • To unexclude a single excluded record, enter F or L in the prefix command area of the excluded line.
  • To unexclude the first n records in a block of excluded records, enter Fn in the prefix command area of the excluded line.
  • To unexclude the last n records in a block of excluded records, enter Ln in the prefix command area of the excluded line.
  • To unexclude all excluded records, enter RESET EXCLUDED on the Command line (see RESET primary command).

After you have excluded records, you can limit the effects of the FIND, CHANGE and DELETE commands to only those records that are excluded or only those that are not-excluded. You do this by including one of the following option parameters with the primary command:

X or EX
Search only excluded records
NX
Search only not-excluded records

For example, the following command changes all occurrences of the string “no”, “NO” or “nO” to “No” in all not-excluded records:

CHANGE NO C'No' ALL NX
Note:
  1. If neither parameter is used with the primary command, both excluded and not-excluded records are affected.
  2. If an excluded record is affected by a primary command, either by using the EX parameter or by not specifying an EXCLUDE parameter, the record becomes not-excluded.