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 5) - Copy lines with search term

&pagelevel(3)&pagelevel

This format of the @ON statement is used to copy all the hit lines in the line ranges that are to be searched into the specified work file.

Operation

Operands

F mode, L mode

@ON

lines[,...] [:cols[:] ] FIND [ALL] [F] [R] [NOT] [PATTERN]

search [,int] [COPY [TO] ] (procnr) [KEEP] [OLD]

lines

cols

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

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 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 is pointless since a record can only
be copied once.

F

Only the first hit line in each specified line range is copied. If F is not
specified then all the hit lines from each specified line range are copied.

R

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

NOT

A hit is identified if the search term is not present in the specified column
range in a line (negative search).

PATTERN

search

The wildcards present in the search term are interpreted.

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.

procnr

The number of the work file (0..22) to which the hit lines are to be copied.

An active work file or the current work file may not be specified. If OLD is not
specified and hit records are found then the target work file is deleted in full
before the copy operation (see @DELETE, format 2). If no hit records are
found then the content of the target work file remains unchanged.

KEEP

The line numbers of the hit records are retained on copying. If KEEP is not
specified, EDT creates the target work file as of the current line number
which is increased by the current increment for each copied hit record.

OLD

The content of the target work file is not deleted before the copy operation.
Any existing lines which have the same line number in the work file are
overwritten. If OLD is not specified and hit records are found then the target
work file is deleted in full before the copy operation (see @DELETE, format
2).

If the specified work file has a character set then the lines that are to be copied are converted into this work file's character set. If characters which cannot be displayed in the work file's character set are identified then these characters are replaced by a substitute character provided that such a character has been specified (see @PAR SUBSTITUTION-CHARACTER); otherwise, the @ ON statement is rejected and error message EDT5453 is output.

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

Records which contain the search term STR are to be copied into work file 5. Processing then branches to work file 5.

Processing branches to work file 1.

All the records corresponding to individuals whose first names start with M and end with A are copied to work file 6. Processing then branches to work file 6.