The @SETLIST statement assigns elements to an S list variable. In this case, values are taken over from lines in the current work file or from string variables.
If no values are specified then the content of the S list variable is deleted.
Operation | Operands | F mode, L mode |
@SETLIST | string { [lines[,...] ] [MARK [m] ] | svar} [:cols[,...]:] |
string | String which specifies the valid name of an S list variable. Although the |
lines | One or more line ranges whose contents are to be taken over into the S list |
MARK | Only marked lines in the specified line ranges are to be taken over. If |
m | Number of the record mark ( |
svar cols | Name of a string variable whose content is to taken over as an element. One or more column ranges whose characters are to be taken over. The If the operand is not specified, the entire line is taken over. |
MODE= | Specifies the way in which a list is to be extended. |
APPEND | The list is extended at the end, i.e. the new list elements are appended after the last element (default value). |
PREFIX | The list is extended at the start, i.e. the new list elements are inserted before |
OVERWRITE | |
The content of the S list variable is first deleted. The new list elements are If no line is present in the specified line range then the S list variable is not | |
name | Character set in which the string for assignment is to be converted before |
The comma in front of the MODE
operand must be specified in order to distinguish it from MARK
if no other operand is specified apart from the list name or any range specification.
The list variable must already exist. If it does not, the message EDT5274
is issued. If it is not a list variable, the message EDT4910
is output. If the list variable is not of type STRING
or ANY
then the statement is rejected with the message EDT5343
.
If an S variable is extended by means of APPEND
or PREFIX
then, in F mode, the message EDT0210
is output to inform the user of this.
In L mode, if the work file is empty and a line range (not a string variable) has been specified then the message EDT2903
is output.
If the string that is to be assigned contains characters which are invalid in the specified character set then these characters are replaced by a substitute character provided that such a character has been specified (see @PAR SUBSTITUTION-CHARACTER); otherwise, no assignment is performed and statement is aborted with the error message EDT5453
.
If the value that is to be assigned is longer than 4096 bytes then only the first 4096 bytes are assigned as a value and the message EDT2403
is output.
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.
For details on S list variables, see the SDF-P User Guide [7].