The @COLUMN statement modifies the content of existing work file lines or string variables.
During the first stage, new text is inserted or existing text is overwritten as of the specified column. Then all the blanks are deleted (as far as the next character which is not a blank) from right to left starting at the last character in the work file line or string variable. A work file line which only consists of blanks remains present as an empty line in the work file. A string variable which only contains blanks becomes an empty string variable after the delete operation.
Operation | Operands | F mode, L mode |
@COLUMN | col ON {lines | svars} [,...] [ { CHANGE | IN SERT} ] [:] string |
col lines | Column as of which text is to be replaced or inserted. One or more line ranges in which text is to be inserted or replaced. Only |
svars | One or more ranges of string variables in which text is to be inserted or |
CHANGE | The string specified with |
INSERT | The string specified with |
: | This specification is obligatory if neither CHANGE nor INSERT is specified in order to clearly separate the range specification from the string . |
string | String which is inserted or which replaces existing text as of the specified The string is converted into the character set used by the work file or string |
If the column as of which the text is to be inserted is located after the previous line end then the intervening columns are filled with blanks.
No text is replaced or inserted if this would cause the work file or string variable line length to exceed the permitted maximum of 32768 characters. Instead, in this case, the message EDT5474
is output. EDT does not check whether deleting blanks at the end of a line would restore the line to a permitted value.
If errors occur during processing (EDT5453
or EDT5474
) then the statement is aborted. Any lines and/or string variables which have been successfully modified up to this point retain their changes.
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
This statement can be used to delete blanks at ends of lines without knowing the line length. If an empty string is specified as the replacement text in the @COLUMN statement then no text is replaced in the lines. The right-to-left delete operation causes blanks to be deleted at the ends of the lines.
Example
The content of column 2.00 is to be entered in line 1.00 as of column 3. The old content of line 1.00 is therefore overwritten.
The string 567 is to be inserted in line 1.00 as of column 5. Consequently, no characters are overwritten in line 1.00.
1.00 123456780<······························································ 2.00 348<···································································· 3.00 ········································································