TRANSFORM
General Format
TRANSFORM identifier-1 CHARACTERS FROM pattern-1 TO pattern-2 |
General rules
OS/VS COBOL supported the TRANSFORM statement and has been replaced by INSPECT CONVERTING statements. isCOBOL supports either statement.
The following OS/VS COBOL TRANSFORM statement:
77 DATA-T PICTURE X(9) VALUE "ABCXYZCCC" . . . TRANSFORM identifier-1 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. identifier-1 DATA-T contains "CATXYZTTT".
The
-cv compiler option is required to compile this statement.