Start of change

SCRUBOUT

SCRUBOUT returns a string with all the characters from a second string removed.

Read syntax diagramSkip visual syntax diagram
>>-SCRUBOUT(x,f-+----+-)---------------------------------------><
                '-,n-'     

x
A string expression that specifies the string from which the characters in the string f will be removed. x must have a CHARACTER type.
f
A string expression that specifies the characters to be removed from x. f must have a CHARACTER type.
n
An optional expression that specifies a location within the string x, from where the compiler begins searching for characters from the string f.

n must have a computational type and is converted to FIXED BINARY(31,0). The default value for n is 1.

If n is less than 1 or greater than length(x)+1, the STRINGRANGE condition will be raised if enabled, and the result will be a null character string.

SCRUBOUT( x, '0123456789' ) will remove all the numeric characters from x.

SCRUBOUT( x, '0123456789', 4 ) will remove all the numeric characters from x after the first 3 characters.






Published: 23 December 2018
End of change