Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
Created SET symbols HLASM Language Reference SC26-4940-06 |
|
The assembler can create SET symbols during conditional assembly processing from other variable symbols and character strings. A SET symbol thus created has the form &(e), where e represents one or more of these:
After substitution and concatenation, e must consist of a string of up to 62 alphanumeric characters, the first of which is alphabetic. The assembler considers the preceding ampersand and this string as the name of a SET variable. If this created SET symbol has the same name as an existing SET symbol, they are treated as identical. If this created SET symbol does not have the name of any existing SET symbol, the usual rules for assigning type and scope apply. You can use created SET symbols wherever ordinary SET symbols are permitted, including declarations. A created SET symbol must not match the name of a system variable symbol, nor the name of a symbolic parameter in a macro prototype statement. You can also nest created SET symbols in other created SET symbols. Consider the following example:
Let &(e) equal &(&ABC(&I)QUA&I).
The name of a created SET symbol cannot match the name of a system variable symbol or of a symbolic parameter in a macro definition. The created SET symbol can be thought of as a form of indirect addressing. With nested created SET symbols, you can perform this kind of indirect addressing to any level. In another sense, created SET symbols offer an associative storage facility. For example, a symbol table of numeric attributes can be referred to by an expression of the form &(&SYM)(&I) to yield the Ith attribute of the symbol name in &SYM. As this example indicates, created SET symbols can be declared and used as arrays of dimensioned variables. Created SET symbols also enable you to achieve some of the effect
of multiple-dimensioned arrays by creating a separate name for each
element of the array. For example, a 3-dimensional array of the form &X(&I,&J,&K) might be addressed as &(X&I.$&J.$&K), where &I, &J, and &K typically have numeric values.
Thus, &X(2,3,4) is represented by &X2$3$4.
The $ separators guarantee that &X(2,33,55) and &X(23,35,5) are unique:
|
Copyright IBM Corporation 1990, 2014
|