Compiler and Run-Time Migration Guide
Document Number GC26-4764-04
TRANSFORM Statement
OS/VS COBOL supports the TRANSFORM statement. IBM COBOL does not
support the TRANSFORM statement, but they do support the INSPECT
statement. Therefore, any TRANSFORM statements in your OS/VS COBOL
program must be replaced by INSPECT CONVERTING statements.
For example, in the following OS/VS COBOL TRANSFORM statement:
77 DATA-T PICTURE X(9) VALUE "ABCXYZCCC"
.
.
.
TRANSFORM DATA-T FROM "ABC" TO "CAT"
TRANSFORM evaluates each character, changing each A to C, each B to A,
and each C to T.
After the TRANSFORM statement is executed. DATA-T contains
"CATXYZTTT".
For example, in the following INSPECT CONVERTING statement (valid only
in IBM COBOL):
77 DATA-T PICTURE X(9) VALUE "ABCXYZCCC"
.
.
.
INSPECT DATA-T
CONVERTING "ABC" TO "CAT"
INSPECT CONVERTING evaluates each character just as TRANSFORM does,
changing each A to C, each B to A, and each C to T.
After the INSPECT CONVERTING statement is executed. DATA-T contains
"CATXYZTTT".