Corrective action for the STRING statement
Because a STRING statement with CMPR2 would automatically overlay any positions represented with the symbol B, all that is really needed is a new alphabetic data-name redefined on the original INTO field. For example:
Statement under CMPR2:
01 ALPHA PIC AABAABAA.
01 VARX PIC A(3) VALUE "XXX".
01 VARY PIC A(3) VALUE "YYY".
STRING VARX VARY DELIMITED BY SIZE INTO ALPHA.
Statement under NOCMPR2:
01 ALPHA PIC AABAABAA
01 BETA REDEFINES ALPHA PIC A(8).
01 VARX PIC A(3) VALUE "XXX".
01 VARY PIC A(3) VALUE "YYY".
STRING VARX VARY DELIMITED BY SIZE INTO BETA.
BETA is redefined on ALPHA and has a length equal to ALPHA, including all symbols of B. BETA is then used in the STRING statement. After STRING is executed, ALPHA will have the same value as it did with CMPR2.