REPLACE

Reference

Syntax

REPLACE { { [{FIRST OCCURRENCE}|{ALL OCCURRENCES OF}]
            {[SUBSTRING] sub_string} | {REGEX regex} IN
            { {[SECTION [OFFSET off] [LENGTH len] OF] dobj}
            | {TABLE itab [FROM lin1 [OFFSET off1]]
                          [TO   lin2 [OFFSET off2]]} }
            WITH new
            [IN {BYTE|CHARACTER} MODE]
            [{RESPECTING|IGNORING} CASE]
            [REPLACEMENT COUNT  rcnt]
            { {[REPLACEMENT OFFSET roff]
               [REPLACEMENT LENGTH rlen]
               [REPLACEMENT LINE   rlen]}
            | [RESULTS result_tab|result_wa] } }
        | { SECTION [OFFSET off] [LENGTH len] OF dobj
            WITH new
            [IN {BYTE|CHARACTER} MODE] } }.


Effect

Replaes byte or character strings in a byte or character- type data object dobj or in an internal table itab with the content of new. Determination of the characters or bytes to be replaced using a search for substrings or regular expressions or by specifying the offset and length directly.

Additions