Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
SETA instruction HLASM Language Reference SC26-4940-06 |
|||||||||||||||||||||||||||||
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--SETA--expression---------------------------><
Figure 1 defines an arithmetic expression.
Figure 1. Defining arithmetic
(SETA) expressions
┌───────────┐ │ │ │Arithmetic │ │Expression │ │ │ └─────┬─────┘ │ V Can be any of ├────────────┬───────────┬────────────────────┬──────────┐ V V V V V ┌─────┴─────┐ ┌────┴────┐ ┌────┴──────────────┐ ┌───┴────┐ ───┴────┐ │Arithmetic │ │ (Arith. │ │ Arithmetic-Valued │ │+Arith. │ │-Arith. │ │Term │ │ Exp.) │ │ Built-in Function │ │∧ Exp. │ │∧ Exp. │ └─────┬─────┘ └─────────┘ └───────────────────┘ └┼───────┘ └┼───────┘ │ └────┬─────┘ V Can be any of │ ├─────────────┬─────────────┬─────────────┐ unary operators V V V V ┌─────┴─────┐ ┌─────┴─────┐ ┌─────┴─────┐ ┌─────┴─────┐ │ │ │Predefined │ │ Self- │ │ │ │ Variable │ │Absolute │ │ Defining │ │ Attribute │ │ Symbol │ │Ordinary │ │ Term │ │ Reference │ │ │ │Symbol │ │ │ │ │ Operators Allowed └───────────┘ └───────────┘ └───────────┘ └─────┬─────┘ │ Unary: + Positive │ - Negative │ Can V only be Binary: + Addition ┌─────┴─────┐ - Subtraction │ Length │ * Multiplication │ Scale │ / Division │ Integer │ │ Count │ Arith. Exp. = Arithmetic Expression │ Number │ │ Defined │ └───────────┘ Table 1 shows the variable symbols that are allowed as terms in an arithmetic expression.
The following example shows a SETA statement with a valid self-defining
term in its operand field:
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:
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
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:
In
this example C'&ASYM3' is not a valid term. |
Copyright IBM Corporation 1990, 2014
|