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 9) - Delete before or after the hit string

&pagelevel(3)&pagelevel

This format of the @ON statement causes EDT to delete the content of a work file line or string variable before or after the hit string if a hit is found.

Operation

Operands

F mode, L mode

@ON

{ lines | svars } [,...] [:cols[:] ]  FIND [ALL] [F] [R] [PATTERN]

search [,int]  DELETE { PREFIX |  SUFFIX }


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

Each time a hit string is found in a line, the text before or after the hit string
is deleted. If, in the case of a left-to-right search, the text after the hit string
is deleted then the specification ALL is of no significance. The same applies
if the text before the hit string is deleted during a right-to-left search. If ALL
is not specified then the delete operation only applies to the first hit string in
a line.

F

In each specified line range, texts are only deleted before or after the hit
strings in the first line containing hits. If F is not specified then text is deleted
before or after the hit strings in each hit line in each specified line range.

R

The lines are searched through from right to left. If R is not specified then
they are searched through from left to right.

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.

PREFIX

The content of the hit line before the hit string is deleted as far as the start
of the record.

SUFFIX

The content of the hit line after the hit string is deleted as far as the end of
the record.

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.

Example

The text preceding the hit is to be deleted before the fourth occurrence of the string ABABAB ('AB'*3,4) in every line in the entire line range (%.-.$).

In line 1, the search term was found for the fourth time as a hit starting at column 22.
In line 2, the search term is found as a hit for the first time starting in column 1, for the
second time starting in column 7, for the third time starting in column 13 and for the fourth
time starting in column 19. When searching for the second and subsequent hits, EDT starts
after a hit string each time.