TRANSLATE function
The TRANSLATE function returns a fixed or varying character string that has a value in which one or more characters of the first argument might have been converted to other characters.
The arguments are defined as follows:
stringExpression | stringExpression is an expression that specifies the string to be converted. stringExpression must return a value that is a built-in single-byte character string data type. stringExpression cannot be a string constant. |
toString | toString is a fixed-length character constant that is assumed to be in the same encoding scheme as the stringExpression. The translate function might not work correctly if the encoding schemes are not the same. The maximum length of toString is 256 characters. If you specify toString you must also specify fromString. If the length of toString is less than the length of fromString ,toString is padded to the length of fromString with the pad or a blank. If the length of toString is greater than fromString, the extra characters in toString are ignored without warning. |
fromString | fromString is a fixed-length character constant that is assumed to be in the same encoding scheme as the stringExpression. The translate function may not work correctly if the encoding schemes are not the same. Alternatively, you can specify the character constant as a hexadecimal constant. The maximum length of fromString is 256 characters. |
pad | pad character is optional and defaults to an EBCDIC blank. You can specify pad as a character string constant or hexadecimal constant with a length not exceeding one character. |
fromString is considered the input translate table, tablei. toString is the output translate table, tableo.
Related topics