The @GETVAR statement outputs the value of an S variable, writes it to a work file or assigns it to a variable.
Operation | Operands | F mode, L mode |
@GETVAR | { string [={ line | svarex | ivar }] | SYSEDT } [,CODE=name] |
string | String which specifies a valid S variable name. Although the name must |
line | Number of the line to which the value of the S variable is to be written. If the value of the S variable is not of type |
svarex | String variable in which the value of the S variable is to be written. If the value of the S variable is not of type |
ivar | Integer variable ( If the value of the S variable is not of type |
SYSEDT | If they exist and their values are of the type |
name | Name of the character set in which the value of the S variable is to be |
If neither line
nor svarex
nor ivar
is specified then the value of the S variable is output to SYSOUT
in interactive mode and in batch mode it is output to SYSLST
.
If the S variable is not present then the message EDT5274
is output. If it has no value then the message EDT5340
is output (except in the case of SYSEDT
).
If a line with a number greater than the previous highest line number is created then the current line number is modified.
If the variable contains an invalid byte sequence (possible in Unicode character sets) then it is not read and the message EDT5454
is output.
If it is assigned to a string variable then this is also assigned the character set specified implicitly or explicitly via name
.
If it is inserted in a work file then the value is converted into the work file's character set. If the work file is empty and has the character set *NONE
then it is assigned the character set specified explicitly or implicitly via name.
If the string that is to be assigned contains characters which cannot be converted into the work file's character set then these characters are replaced by a substitute character provided that such a character has been specified (see @PAR SUBSTITUTION-
CHARACTER); otherwise, the string is not assigned and the error message EDT5453
is output.
For details on S variables, see the SDF User Guide [6].