skip to main content

Procedure Division Statements : TRANSFORM

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(9VALUE "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.

Copyright (c) 2017 Veryant
Contact us
Please share your comments on this manual or on any
Veryant product documentation with the email button at the top left