In z/OS HLASM, I'm wondering if there is a way to "unequate" a symbol that was defined via the EQU instruction. For example:

MyValue  EQU 999
...
         LHI R5,MyValue
...
MyValue  UNEQU     <===== or something that returns MyValue to the undefined state for the next statement in the assembly

I suppose this would be simiar in concept to a DROP following a USING to "scope" the relationship between a register and a DSECT, but in this case it would mean "this symbol is only valid within the scope between the EQU and the 'unEQU'."

Thanks, Scott

1

There are 1 best solutions below

1
Hogstrom On

EQU creates a symbol and once defined its there for life. Its not like a #define pragma in C.

IBM's Reference Manual for HLASM and the EQU Instruction

In essence you are creating a symbol it is entered and cannot be removed. The manual does not specifically indicate this but given that once a symbol is defined with EQU it also cannot be changed.

For grins I tried a few variations and this was the result of trying to redefine the symbol ABC

  Active Usings: None                                                
  Loc  Object Code    Addr1 Addr2  Stmt   Source Statement           
000000                00000 00000     1 EQUTEST CSECT                
                      00001           2 ABC EQU 1                    
                      00002           3 ABC EQU 2                    
** ASMA043E Previously defined symbol - ABC                          
** ASMA435I Record 3 in USER1.TEST.SOURCE(EQUTEST) on volume: T70502