DELETE primary command

The DELETE primary command deletes records from a data set or data set member.

Syntax

Read syntax diagramSkip visual syntax diagram
Syntax (CHAR, HEX, LHEX or TABL display format)

>>-+-DELETE-+--+-ALL--+--------+--+----------------+-+---------><
   '-DEL----'  |      +-X------+  '-label1--label2-' |   
               |      +-EX-----+                     |   
               |      |    (1) |                     |   
               |      '-NX-----'                     |   
               '-+--------+--label1--label2----------'   
                 +-X------+                              
                 +-EX-----+                              
                 |    (1) |                              
                 '-NX-----'                              

Notes:
  1. If none of these parameters (X, EX or NX) is specified, then the DELETE command applies to both excluded and not-excluded records.

In SNGL display format, DELETE deletes the current record.

Read syntax diagramSkip visual syntax diagram
Syntax (SNGL display format)

>>-+-DELETE-+--------------------------------------------------><
   '-DEL----'   

ALL
Causes the DELETE command to delete all records (or all excluded or not-excluded records) within the specified range of records (or within the entire data set, if you do not specify a range).

If you do not specify the ALL parameter, then the DELETE command deletes only the first record (or only the first excluded or not-excluded record) within the specified range.

Note: Suppressed or not-selected records that are hidden from display or represented by shadow lines are not affected by the DELETE command, even when the ALL parameter is specified.
EX
Excluded records only.
label1
Label identifying the start of a range of records. The label must start with a period (.) followed by one to four alphabetic characters (no numeric or special characters). Labels starting with the letter “Z” indicate an editor-assigned label.
label2
Label identifying the end of a range of records. The label must start with a period (.) followed by one to four alphabetic characters (no numeric or special characters). Labels starting with the letter “Z” indicate an editor-assigned label.
NX
Not-excluded records only.
X
Same as EX.

Availability

Related tasks and examples