Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
Created SET symbols HLASM General Information GC26-4943-06 |
|
You can create SET symbols during the generation of a macro. A
created SET symbol has the form &(e), where e represents
one or more of the following:
After substitution and concatenation, e must consist of
a string of 1 to 62 alphanumeric characters, the first being alphabetic.
This string is then used as the name of a SETx variable. For example:
&X is
a variable whose value is the name of the variable to be updated.These statements have an effect identical to:
You can use created SET symbols wherever ordinary SET symbols are permitted, including declarations; they can even be nested in other created SET symbols. The created SET symbol can be thought of as a form of indirect addressing. With nested created SET symbols, you can use such indirect addressing to any level. Created SET symbols can also offer an "associative memory" facility. For example, a symbol table of numeric attributes can be referenced by an expression of the form &(&SYM)(&I) to yield the I-th element of the symbol substituted for &SYM. Note that the value of &SYM need not be the name of a valid symbol; thus created SET symbols may have arbitrary names. Created SET symbols also allow you to achieve some of the effect of multidimensional arrays by creating a separate named item for each element of the array. For example, a three-dimensional array of the form &X(&I,&J,&K) can be addressed as &(X&I.$&J.$&K). Then &X(2,3,4) is represented as a reference to the symbol &X2$3$4. Note that what is being created here is a SET symbol. Both creation and recognition occur at macro-generation time. In contrast, the names of parameters are recognized and encoded (fixed) at macro-edit time. If a created SET symbol name happens to coincide with a parameter name, the coincidence is ignored and there is no interaction between the two. |
Copyright IBM Corporation 1990, 2014
|