Deleting records

You can delete records when in any display format, by using the DELETE primary command. This allows you to delete all the records in a data set or to delete multiple records based upon the following common factors:

  • All excluded or not-excluded records (see Excluding records).
  • All records that fall within a range specified by labels (see Labelling record ranges).
  • All excluded or not-excluded records that fall within a labeled range.

To delete records that have a common factor:

  1. Establish the common factor for your records, that is, create your labels and/or exclude the required records.
  2. Enter the DELETE primary command, together with your choice of parameters, on the Command line.

Examples

The following command deletes all excluded records:

DELETE ALL EX

The following command deletes the next not-excluded record in the range of records from the label .LABA to the label .LABB:

DELETE NX .LABA .LABB

In CHAR, HEX, LHEX or TABL display formats, you can also delete records by using the D prefix command. Using the prefix command allows you to delete individually selected records or blocks of records that have no other common factor.

To delete individually selected records:

  1. Perform either of these actions:
    • Position your cursor in the prefix area of the first record to be deleted and type the D or Dn prefix command, where n represents the number of records to be deleted.
    • Type DD in the prefix area of the first record of a block of records to be deleted and DD in the prefix area of the last record in the block.
  2. Press Enter. The record or record are deleted from the data set.
Note: The deletion of these records is not saved to file until a SAVE, FILE, END or EXIT command is issued. You can recover these deleted records, before ending your editing session, by using the RECOVER primary command.