TRANSLATE Function: z/OS

Replaces specific characters in a character expression.
Category: Character
z/OS specifics: to/from pairs
See: TRANSLATE Function in SAS Functions and CALL Routines: Reference

Syntax

TRANSLATE(source, to-1, from-1, <... to-n, from-n> )

Required Arguments

source
specifies the SAS expression that contains the original character value.
to
specifies the characters that you want TRANSLATE to use as substitutes.
from
specifies the characters that you want TRANSLATE to replace.

Details

Under z/OS, you must specify pairs of to and from arguments. Also, there is no practical limit to the number of to or from pairs that you can specify.
TRANSLATE handles character replacement for single-byte character sets only. See KTRANSLATE to replace single-byte characters with double-byte characters, or to replace double-byte characters with single-byte characters.