COPY A REPLACING == A == BY == X ==
== B == BY == Y ==
== A:B == BY == Z ==.
MOVE A:B TO ID2.
CMPR2 NOCMPR2
MOVE Z TO ID2. MOVE X:Y TO ID2.
Because ":" is a separator under Enterprise COBOL, "A:B" is broken up into three separate tokens: "A" ":" and "B." The replacements for A and B are made first.