Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

@ON (format 10) - Delete lines or string variables which contain the search term

&pagelevel(3)&pagelevel

This format of the @ON statement causes EDT to delete the line or the content of a string variable which contains the search term. In this case, string variables are reinitialized with a blank and contain the character set EDF041.

Operation

Operands

F mode, L mode

@ON

{ lines | svars } [,...] [:cols[:] ] F IND [ A LL] [ F ] [ R ] [ NOT ] [ P ATTERN]

search [,int] DELETE

lines

svars

One or more line ranges in which the search is to be performed.

One or more ranges of string variables in which the search is to be
performed.

cols

Contiguous column range to which the search is to be limited.

If the range specification contains only a single column specification, this
indicates the range from the specified column through to the end of the line.
If the first column specification is greater than the line length then the line or
string variable is ignored.

If no column range is specified then the column range specified with
@SEARCH-OPTION is used.

ALL

Although the specification is permitted, it serves no purpose since a line is
always deleted when the first hit string is found.

F

Only the first hit line in each specified line range is deleted. If F is not
specified then each line containing the hit string in each line range is
deleted.

R

This specification is pointless since whether or not hits are found in a work
file line is independent of the direction of the search.

NOT

A line is deleted if the search term is not found in the specified column range
in a line (negative search).

PATTERN

The wildcards present in the search term are interpreted.

search

Search term that is to be searched for in the search range (for details, see
section “Searching with @ON”). It is not permissible to specify
an empty string.

int

Only the intth occurrence of the search term in a line is considered to
represent the first hit. Values between 1 and 32768 are permitted for int.
The default value for int is 1 byte.

If the statement is interrupted with [K2] and the EDT session is continued with /INFORM-PROGRAM then the processing of the statement is aborted and message EDT5501 is output.

Note

All the empty lines (records of length 0) in a range can be deleted using the statement @ON lines FIND NOT PATTERN '/' DELETE if '/' is the wildcard that stands for precisely one character.

Example

All the lines in the work file that contain three or more occurrences of the string ABC are to be deleted.

Lines 1, 2 and 3 have been deleted. Next, all the lines in the entire work file in which the character A occurs after column 7 are to be deleted.

Line 4 has been deleted. Next, all the lines in the entire work file which contain two consecutive blanks ’'BLANK''BLANK'’ are to be deleted.

Line 5 has been deleted.