Your Browser is not longer supported

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

{{viewport.spaceProperty.prod}}

@SETVAR - Declare S variable and assign value

&pagelevel(3)&pagelevel

The @SETVAR statement is used to declare an S variable and/or assign a value to an S variable.

Operation

Operands

F mode, L mode

@SETVAR

{string[={string1 | ivar} ] | SYSEDT [,KEEP] }
[,MODE={ ANY | NEW | UPDATE} [,CODE=name]

string

String which specifies a valid S variable name. Although the name must
comply with the syntactic rules for S variable names, EDT does not check
these rules in full.

string1

String which is to be assigned to the S variable.

If the S variable is not of type STRING or ANY or if it is an array or list then
the statement is aborted with the message EDT5342.

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.

ivar

Integer variable (#I0..#I20) whose content is to be assigned as a value to
the S variable specified in string.

If the S variable is not of type INTEGER or ANY or if it is an array or list then
the statement is aborted with the message EDT5342.

SYSEDT

The contents of the string variables #S00 to #S20 are assigned to the S
variables SYSEDT-S00..SYSEDT-S20. If errors occur, the corresponding
messages are output and the same message may be repeated. This does
not terminate the statement.

In the case of S variables to which no string can be assigned as a value
(other type) no error is reported and no assignment is performed. The
treatment of non-existent S variables depends on the MODE setting.

KEEP

If KEEP is specified then EDT is set not to overwrite the S variables SYSEDT-
S00..SYSEDT-S20 on termination. If KEEP is not specified then the setting
is canceled, i.e. on termination, EDT assigns the contents of the string
variables #S00 to #S20 using the character set EDF041.

MODE=

ANY

NEW

Specifies whether the S variable should already exist.

A value is assigned to an existing or a new S variable.

The S variable must not already exist. If it already exists then the statement
is not executed and the message EDT5272 is output. If SYSEDT is specified
then the specification of NEW is treated in the same way as ANY.

UPDATE

The S variable must already exist. If it does not already exist then the
statement is not executed and the message EDT5274 is output. If SYSEDT
is specified then the message is not output and values are only assigned to
existing S variables of type STRING or ANY.

name

Character set in which the string for assignment is to be converted before
being assigned. If name is not specified, EDF041 is used. If string is
specified but string1 is not then the operand is ignored. Otherwise, the
character set name must be known in XHCS. If it is not, the statement is
rejected with message EDT4980.

If string is specified but there is no specification for either string1 or ivar then an empty string is assigned as a value to the S variable. If it does not yet exist then it is created with default attributes (TYPE=ANY,MULTIPLE-ELEMENTS=*NO,SCOPE=PROCEDURE). If the variable already exists and has incompatible attributes then the statement is rejected with the message EDT5342.

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 the error message EDT5453 is output.

For details on S variables, see the SDF User Guide [6].