Your Browser is not longer supported

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

{{viewport.spaceProperty.prod}}

@SEQUENCE (format 1) - Perform line numbering

&pagelevel(3)&pagelevel

The @SEQUENCE statement (format 1) causes EDT to write a number in each line of a contiguous line range.
A predefined number consisting of a maximum of 8 digits (possibly with leading zeros) is written to the first line of the line range. This also defines the number of digits in all the following numbers. All the following numbers are given by the total of the preceding number plus the predefined increment. If this process would result in a number containing more digits than are present in the starting number then only the same number of digits from the right as are present in the starting number are used.

This statement overwrites any content in columns in which the numbers are written.

Operation

Operands

F mode, L mode

@SEQUENCE

[ {lines | svars} ] [: [col] [: [n1] [(n2)] ] ] 

lines

svars

EDT writes a number to each line in the specified line range.

EDT writes a number to each string variable in the specified range of string
variables.

col

The operand specifies the column which is to accommodate the first digit of
the number that is to be written. If a line in the specified line range has fewer
columns than are specified in the col then the columns between the
previous line end and the column col are filled with blanks.

If the col operand is missing, EDT writes the first digit in column 73.

n1

This operand specifies the integer value that EDT is to write as a decimal
number in the first line of the relevant line range. The n1 operand may
consist of a maximum of 8 digits (possibly with leading zeros). The numbers
that are written in the following lines have the same number of digits.

If the n1 operand is missing, EDT writes the number 00000100 in the first
relevant line.

n2

This operand specifies the increment (as an integer value) for the formation
of the following numbers. Each of these numbers consists of the sum of the
preceding number and the increment. During this process, only as many
digits are used starting from the right as are present in the starting number
n1.

If the n2 operand is missing, EDT uses the value 100 as the increment.

If neither the lines nor the svars operand is specified then EDT writes a number in every line of the current work file.

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

The choice of starting value and increment determines whether the sequence of numbers generated by the @SEQUENCE statement (format 1) is ascending, descending or constant. For example, the starting value 0100 and increment 100 result in the ascending sequence of numbers 0100, 0200, 0300, etc., at least up to the value 9900.
After that, the value reverts to 0000 and numbering continues with 0100, 0200 etc.
If the starting value 999 is selected in combination with the increment 998, then the descending sequence 999, 997, 995 etc. is obtained. When the value 001 is reached, the next number is 999 again and the sequence repeats from the beginning.

In the example above, the same result could be obtained by setting the increment to 3998, for example, because the leading 3 is omitted in each newly formed number. An alternating sequence of numbers can be obtained, for example, by setting the starting value 3 and the increment 5: 3, 8, 3, 8, etc. The easiest way to obtain a constant sequence is to set the increment 0.