How to remove trailing characters?

While *TRIM is available for static variables, the result is no different than a MOVE LEFT JUSTIFIED statement. *TRIM(#A,TRAILING) has no affect on a static variable.

Example:


DEFINE DATA LOCAL                          
1 #A  (A8) INIT <' text  '>                
1 #B  (A8)                                 
1 #D  (A)  DYNAMIC                         
END-DEFINE                                 
*                                          
MOVE *TRIM(#A,TRAILING) TO #B              
MOVE *TRIM(#A,TRAILING) TO #D              
WRITE   '=' #A ':' #A (EM=HHHHHHHH)        
      / '=' #B ':' #B (EM=HHHHHHHH)        
      / '=' #D (AL=8) ':' #D (EM=HHHHHHHH) 
END                                        

Result:


#A:  text    : 40A385A7A3404040     
#B:  text    : 40A385A7A3404040     
#D:  text    : 40A385A7A3