Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
Using SETA symbols HLASM Language Reference SC26-4940-06 |
|
The arithmetic value assigned to a SETA symbol is substituted for the SETA symbol when it is used in an arithmetic expression. If the SETA symbol is not used in an arithmetic expression, the arithmetic value is converted to a character string containing its absolute value, with leading zeros removed. If the value is 0, it is converted to a single 0. Example:
Statements 1 and 2 assign the arithmetic values +10 and +12 to the SETA symbols &A and &B. Therefore, statement 3 assigns the SETA symbol &C the arithmetic value -2. When &C is used in statement 5, the arithmetic value -2 is converted to the character 2. When &C is used in statement 4, however, the arithmetic value -2 is used. Therefore, &D is assigned the arithmetic value +8. When &D is used in statement 6, the arithmetic value +8 is converted to the character 8. The following example shows how the value assigned to a SETA symbol
can be changed in a macro definition.
Statement 1 assigns the arithmetic value +5 to SETA symbol &A. In statement 2, &A is converted to the character 5. Statement 3 assigns the arithmetic value +8 to &A. In statement 4, therefore, &A is converted to the character 8, instead of 5. A SETA symbol can be used with a symbolic parameter to refer to an operand in an operand sublist. If a SETA symbol is used for this purpose, it must have been assigned a positive value. Any expression that can be used in the operand field of a SETA instruction can be used to refer to an operand in an operand sublist. Sublists are described in Sublists in operands. The following macro definition adds the last operand in an operand
sublist to the first operand in an operand sublist and stores the
result at the first operand. A sample macro instruction and generated
statements follow the macro definition.
&NUMBER is the first symbolic parameter in the operand field of the prototype statement (statement 1). The corresponding characters (A,B,C,D,E) of the macro instruction (statement 4) are a sublist. Statement 2 assigns to &LAST the arithmetic value +5, which is equal to the number of operands in the sublist. Therefore, in statement 3, &NUMBER(&LAST) is replaced by the fifth operand of the sublist. |
Copyright IBM Corporation 1990, 2014
|