SET symbol definition
When you define a SET symbol, you determine its scope. The scope of the SET symbol is that part of a program for which the SET symbol has been declared. A SET symbol can be defined as having local scope or global scope.
If you declare a SET symbol to have local scope, you can use it only in the statements that are
part of:
- The macro definition in which it was defined, or
- Open code, if it was defined in open code
If you declare a SET symbol
to have global scope, you can use it in the statements that are part of:
- The same macro definition
- A different macro definition
- Open code
To help you with SET symbol definition, High Level Assembler provides
the following facilities:
- A SET symbol is declared implicitly when it appears in the name field of a SETx instruction, and it has not been declared in a LCLx or GBLx instruction. It is assigned as having local scope. If the assembler subsequently encounters any local scope explicit declaration of the symbol, the symbol is flagged as a duplicate declaration. A SET symbol is declared as an array if the name field of the SETx instruction contains a subscript. See Array processing with SET symbols.
- Global and local SET symbol declarations are processed at conditional assembly time. Both a macro definition and open code can contain more than one declaration for a given SET symbol, as long as only one is encountered during a given macro generation or conditional assembly of open code.
- A SET symbol can be defined as an array of values by specifying a subscript when you declare it, either explicitly or implicitly. All such SET symbol arrays are open-ended; the subscript value specified in the declaration does not limit the size of the array, as shown in the following example:
Name Operation Operand
LCLA &J(50)
&J(45) SETA 415
&J(89) SETA 38