A current line number and current increment are assigned to each work file. In L mode, data is entered in the line with the current line number.
The new, current line number is then determined on the basis of the previous current line number plus the current increment value. If WRTRD
is used to perform a read operation in L mode then the current line number is used as a prompt for data entry. A line with the current line number may exist but this is not obligatory.
In some EDT statements, the location in the work file at which the lines are to be inserted can be defined by means of a temporary current line number and a temporary current increment which are specified using the operands of the corresponding EDT statement and which are valid only in this single statement or, otherwise, assume the role of the current line number and current increment in this EDT statement. The current line number can also be changed by running this type of EDT statement.
When EDT is started or after a work file has been completely deleted
(either explicitly or implicitly), the current line number is 1.0000
and the current increment is 1.0000
. The current line number and the current increment can be redefined using the @SET statement (Format 6) or the current increment can be set separately by means of @PAR INCREMENT.
The statements @+ and @- are used to redefine the current line number by adding or subtracting the current increment to or from the previous current line number. If the @EDIT statement has first been issued with the SEQUENTIAL
operand then the current line number is only formed in this way if there are no lines between the previous current line number and the new current line number. If this is not the case, the first intervening line number becomes the current line number. In all cases, the current increment remains unchanged.
The @RENUMBER statement modifies both the current line number and the current increment. The new current line number is the line number of the last line in the work file after renumbering plus new current increment defined by means of the @RENUMBER statement. If only a line number is specified in the @RENUMBER statement then the new current increment is implicitly defined in the same way on the basis of this line number as, for example, in the @SET statement, format 6 (see section “Implicit increment assignment”).
The current line number and the current increment are also modified by all statements which completely delete the work file either explicitly or implicitly. After the explicit or implicit deletion to the complete work file, the current increment is 1.0000
and the current line number is 1.0000
. However, if the entire work file is implicitly deleted, the current line number is then usually modified again by the application responsible for deletion.
If the @SET statement (format 6) is used to modify the current line number and the current increment then the pair of values consisting of the previous current line number and the previous current increment is saved in a memory area which may contain a maximum of three such pairs of values (see the description of the @SET statement, format 6).
If the @SET statement (format 6) is specified without parameters then the last pair of values saved in this memory area becomes the current line number and current increment again. All the statements which explicitly or implicitly delete the work file also completely delete this memory area.