The SETA instruction assigns an arithmetic value to a SETA symbol. You can
specify a single value or an arithmetic expression from which the
assembler computes the value to assign.
You can change the values assigned to an arithmetic or SETA symbol.
This lets you use SETA symbols as counters, indexes, or for other
repeated computations that require varying values.
variable_symbol
Is a variable symbol.
A global variable symbol in the name
field must have been previously declared as a SETA symbol in a GBLA
instruction. Local SETA symbols need not be declared in an LCLA instruction.
The assembler considers any undeclared variable symbol found in the
name field of a SETA instruction as a local SET symbol. The variable
symbol is assigned a type attribute value of N.
expression
Is an arithmetic expression evaluated as a signed 32 bit arithmetic
value that is assigned to the SETA symbol in the name field. The
minimum and maximum allowable values of the expression are -231 and
+231-1.
The following example shows a SETA statement with a valid self-defining
term in its operand field:
&ASYM1 SETA C'D' &ASYM1 has value 196 (C'D')
The second statement in the following example is valid because
in the two positions in the SETA operand where a term is required
(either side of the + sign), the assembler finds a valid self-defining
term:
&CSYM2 SETC 'C''A''' &CSYM2 has value C'A'
&ASYM3 SETA &CSYM2+&CSYM2 &ASYM3 has value 386 (C'A' + C'A')
If the variable symbol is the same as the character
value, the assembler considers the variable symbol to be an implicitly
defined local SETA symbol, which is given a value of zero. For example:
&ASYM2 SETA &ASYM2
&ASYM2
has a value 0.
A SET statement is not rescanned by the assembler to see if substitutions
might affect the originally determined syntax. The original syntax
of the self-defining term must be correct. Therefore the assembler
does not construct a self-defining term in a SETA statement. The
third statement of the next example shows this:
&CSYM3 SETC '3' &CSYM has value 3 (C'3')
&ASYM3 SETA &CSYM3 &ASYM has value 3
&ASYM4 SETA C'&ASYM3' Invalid self-defining term