This format of the @ON statement copies all the records marked with the specified record mark in the searched line ranges into the specified work file.
Operation | Operands | F mode, L mode |
@ON | lines[,...] [:cols[:]] FIND [ALL] [F] [R] [NOT] MARK m [COPY [TO] ] (procnr) [KEEP] [OLD] |
lines cols | One or more line ranges in which the search is to be performed. Although the column range may be specified, this has no significance since |
ALL | Although the specification is permitted, it is pointless since a record can only |
F | Only the first hit record with the specified record mark in each specified line |
R | This specification is of no significance since the search direction is irrelevant |
NOT | If This format cannot be used to copy records which do not have a record |
m procnr | Number of the record mark ( The number of the work file ( An active work file or the current work file may not be specified. If |
KEEP | The line numbers of the hit records are retained on copying. If |
OLD | The content of the target work file is not deleted before the copy operation. |
If the specified work file is empty or has been completely deleted and has the character set *NONE
then it is assigned the character set of the current work file when the copy operation is performed.
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.
When lines are copied to the target work file, record marks are not taken over.
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
Line range 1 to 5 is to be checked for record mark 2 and the hit records are to be copied together with their line numbers to work file 3. Processing then branches to work file 3.