The following example shows two variants of replacechar.
begin returns char;
/* i5 code points that cause errors in Teradata target. */
/* We will replace them with the 'replace_char' code point */
/* "COL_NAME" is the name of the character column needing cleansing */
declare char input_value = nulltostring(COL_NAME, '<null>');
declare int replace_char = 0x21; /* this is an exclamation point - set to desired ASCII character! */
/* Code points to be cleansed: 0x80 through 0x85 inclusive and 0x1A */
return replacechar( replacechar(input_value, 0x80, 0x85, replace_char),
0x1A, replace_char);
end;