The DCTRAN function translates a single-byte or double-byte character within a character string to another character based on its decimal value. To use DCTRAN, you need to know the decimal equivalent of the characters in internal machine representation.
The DCTRAN function can translate single-byte to double-byte characters and double-byte to single-byte characters, as well as single-byte to single-byte characters and double-byte to double-byte characters.
DCTRAN(length, source_string, indecimal, outdecimal, output)
Is the number of characters in source_string.
Is the character string to be translated.
Is the ASCII or EBCDIC decimal value of the character to be translated.
Is the ASCII or EBCDIC decimal value of the character to be used as a substitute for indecimal.
Is the name of the field that contains the result, or the format of the output value enclosed in single quotation marks (').
In the following: