HLASM Language Reference
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


GBLA, GBLB, and GBLC instructions

HLASM Language Reference
SC26-4940-06

Use the GBLA, GBLB, and GBLC instructions to declare the global SETA, SETB, and SETC symbols you need. The SETA, SETB, and SETC symbols are assigned the initial values of 0, 0, and null character string.
Read syntax diagramSkip visual syntax diagram
                                  .-,---------------.   
                                  V                 |   
>>-+-----------------+--+-GBLA-+----variable_symbol-+----------><
   '-sequence_symbol-'  +-GBLB-+                        
                        '-GBLC-'                        

sequence_symbol
Is a sequence symbol.
variable_symbol
Is a variable symbol, with or without the leading ampersand (&).

These instructions can be used anywhere in the body of a macro definition or in the open code portion of a source module.

Any variable symbols declared in the operand field have a global scope. They can be used as SET symbols anywhere after the pertinent GBLA, GBLB, or GBLC instructions. However, they can be used only within those parts of a program in which they have been declared as global SET symbols; that is, in any macro definition and in open code.

The assembler assigns an initial value to the SET symbol only when it processes the first GBLA, GBLB, or GBLC instruction in which the symbol appears. Later GBLA, GBLB, or GBLC instructions do not reassign an initial value to the SET symbol.

Multiple GBLx statements can declare the same variable symbol so long as only one declaration for a given symbol is encountered during the expansion of a macro.

The following rules apply to the global SET variable symbol:
  • Within a macro definition, it must not be the same as any symbolic parameter declared in the prototype statement.
  • It must not be the same as any local variable symbol declared within the same local scope.
  • The same variable symbol must not be declared or used as two different types of global SET symbol; for example, as a SETA or SETB symbol.
  • Do not begin a global SET symbol with &SYS, because these characters are used for system variable symbols.
  • If the variable symbol is the same as the character value, the assembler considers the variable symbol to be an implicitly defined local SETC symbol which is given a null character string value. For example: &C6 SETC '&C6' , assigns the value '' to &C6.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014