Moinsen,

poste mal bitte Deinen Programmcode, normalerweise dürften nicht automatisch irgendwelche Leerzeichen fehlen, sofern Du %replace benutzt...

Gruß
Maxx


Im folgenden Beispiel wird 'ABC' durch 'ZXYDE' ersetzt.:

Code:
 

D Text50          S             50A   inz(*Blanks)     
D MyString        S             10A   varying          
D NewString       S             10A   varying          
D Position        S              5U 0                  
*--------------------------------------------------------- 
/free                                                                         
    Text50      = 'ABCxyABCvwABC123ABC50';                                     
    Dsply Text50;                                                              
    MyString    = 'ABC';                                                       
    NewString   = 'ZXYDE';                                                     
    Position    = 1;                                                           
                                                                               
    DoW  %Scan(MyString: Text50: Position) <> *Zeros;                          
         Text50   = %Replace(NewString: Text50:                                
                       %Scan(MyString: Text50: Position): %Len(MyString));     
         Dsply Text50;       
    Enddo;                                                                     
                                                                               
    Dsply Text50;      
    *INLR = *ON;                                                        
/End-Free 




oder per SQL 


c/EXEC SQL   Set :Text50 = Replace(:Text50, :MyString, :NewString) 
C/END-EXEC