DELETE statement

The DELETE statement is an extended source library statement. It removes COBOL statements from a source program that was included by a BASIS statement.

Format

Read syntax diagramSkip visual syntax diagramsequence-numberDELETEsequence-number-field
sequence-number
Can optionally appear in columns 1 through 6, followed by a space. The content of this field is ignored.
DELETE
Can appear anywhere within columns 1 through 72. The keyword DELETE must be followed by a space and the sequence-number-field. There must be no other text in the statement.
sequence-number-field
Each number must be equal to a sequence-number in the BASIS source program. This sequence-number is the six-digit number the programmer assigns in columns 1 through 6 of the COBOL coding form. The numbers referenced in the sequence-number-field of INSERT or DELETE statements must always be specified in ascending numeric order.

The sequence-number-field must be one of the following options:

  • A single number
  • A series of single numbers
  • A range of numbers (indicated by separating the two bounding numbers of the range by a hyphen)
  • A series of ranges of numbers
  • Any combination of one or more single numbers and one or more ranges of numbers

Each entry in the sequence-number-field must be separated from the preceding entry by a comma followed by a space. For example:


000250 DELETE  000010-000050, 000400, 000450

Source program statements can follow a DELETE statement. These source program statements are then inserted into the BASIS source program before the statement following the last statement deleted (that is, in the example above, before the next statement following deleted statement 000450).

If a DELETE statement begins in column 12 or higher and a valid sequence-number-field does not follow the keyword DELETE, the compiler assumes that this DELETE statement is a COBOL DELETE statement.

Usage note: If INSERT or DELETE statements are used to modify the COBOL source program provided by a BASIS statement, the sequence field of the COBOL source program must contain numeric sequence numbers in ascending order. The source file remains unchanged. Any INSERT or DELETE statements referring to these sequence numbers must occur in ascending order.