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 2) - Output the start column of a hit string

&pagelevel(3)&pagelevel

This format of the @ON statement causes EDT to output the line numbers and the numbers of the columns in which hit strings begin when searching in work files. In interactive mode, the output is written to SYSOUT and in batch mode it is written to SYSLST. If no search term is specified in the statement, EDT outputs the line numbers and the length of each line in the specified line range.

When the search is performed in string variables, the names and lengths of the string variables are output instead of the line numbers and line lengths. The length specifications indicate the number of characters in the lines or string variables.

Operation

Operands

F mode, L mode

@ON

{ lines | svars } [,...] [:cols[:]] CO LUMN

[ [ALL] [F] [R] [PATTERN] search [,int] ]

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 value of the column at which the
string begins is output. If ALL is not specified then only the column value
corresponding to the first hit string in a line is output.

F

Only the column values for the first hit line in each specified line range are
output. If F is not specified then the column value for each hit line in each
line range is output.

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

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.

The output column values have five digits since the maximum number of characters that can be accommodated in a work file line or a string variable is 32768. A line of output may contain up to 10 column specifications followed by a line feed. The line number is not output in the continuation line.

Example

The lengths of all the lines are to be output.

The column at which the string ’E ’ occurs for the first time (searching from the right) is to be output.

All the columns in which the string 'E ' occurs in line 1 are to be output.

The column number of the hit (i.e. third occurrence of the search term E) is to be output for
all the lines which contain at least three occurrences of the string E.

All the lines and column numbers which contain the search term are to be output.