Rational Developer for System z
Enterprise PL/I for z/OS, Version 3.8, Language Reference Manual

TRANSLATE

TRANSLATE returns a CHARACTER string of the same length as x, but with selected characters translated.

Read syntax diagramSkip visual syntax diagram>>-TRANSLATE(x,y-+----+-)--------------------------------------><
                 '-,z-'
 
x
Expression to be searched for possible translation of its characters.

x should have CHARACTER type, and if not, it is converted thereto.

y
Expression containing the translation values of characters.

y should have CHARACTER type, and if not, it is converted thereto.

z
Expression containing the characters that are to be translated. If z is omitted, it defaults to COLLATE.

z should have CHARACTER type, and if not, it is converted thereto.

TRANSLATE operates on each character of x as follows:

If a character in x is found in z, the character in y that corresponds to that in z is copied to the result; otherwise, the character in x is copied directly to the result. If z contains duplicates, the leftmost occurrence is used.

y is padded with blanks, or truncated, on the right to match the length of z.


Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)