22.02.2015 Views

HLASM Language Reference

HLASM Language Reference

HLASM Language Reference

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

SET Symbols<br />

The dimension (the maximum value of the subscript) of a subscripted SET symbol<br />

is not determined by the explicit or implicit declaration of the symbol. The<br />

| dimension specified can be exceeded in later SETx instructions. Note, however,<br />

| that increasing the dimension of a subscripted SET symbol also increases the<br />

| storage required. For example, referencing only &ARRAY(1000000) still causes the<br />

| preceding 999999 elements to be allocated. You can determine the maximum<br />

| subscript using the N' attribute (see “Number Attribute (N')” on page 336).<br />

The subscript can be a subscripted SET symbol.<br />

Created SET Symbols<br />

The assembler can create SET symbols during conditional assembly processing<br />

from other variable symbols and character strings. A SET symbol thus created has<br />

the form &(e), where e represents one or more of the following:<br />

Variable symbols, optionally subscripted<br />

Strings of alphanumeric characters<br />

Other created SET symbols<br />

After substitution and concatenation, e must consist of a string of up to 62<br />

alphanumeric characters, the first of which is alphabetic. The assembler considers<br />

| the preceding ampersand and this string as the name of a SET variable. If this<br />

| created SET symbol has the same name as an existing SET symbol, they are<br />

| treated as identical. If this created SET symbol does not have the name of any<br />

| existing SET symbol, the usual rules for assigning type and scope apply.<br />

You can use created SET symbols wherever ordinary SET symbols are permitted,<br />

| including declarations. A created SET symbol may not match the name of a<br />

| system variable symbol, nor the name of a symbolic parameter in a macro<br />

| prototype statement. You can also nest created SET symbols in other created SET<br />

| symbols.<br />

Consider the following example:<br />

&ABC(1) SETC<br />

'MKT','27','$5'<br />

Let &(e) equal &(&ABC(&I)QUA&I).<br />

&I &ABC(&I) Created SET Symbol Comment<br />

1 MKT &MKTQUA1 Valid<br />

2 27 &27QUA2 Invalid: character after '&' not alphabetic<br />

3 $5 &$5QUA3 Valid<br />

4 &QUA4 Valid<br />

| The name of a created SET symbol cannot match the name of a system variable<br />

| symbol or of a symbolic parameter in a macro definition.<br />

The created SET symbol can be thought of as a form of indirect addressing. With<br />

nested created SET symbols, you can perform this kind of indirect addressing to<br />

any level.<br />

In another sense, created SET symbols offer an associative storage facility. For<br />

example, a symbol table of numeric attributes can be referred to by an expression<br />

of the form &(&SYM)(&I) to yield the Ith attribute of the symbol name in &SYM. As<br />

Chapter 9. How to Write Conditional Assembly Instructions 323

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!