Replaces or removes all occurrences of a substring in a character string.
Category: | Character |
specifies a character constant, variable, or expression that you want to translate.
specifies a character constant, variable, or expression that is searched for in source.
Requirement | The length for target must be greater than zero. |
specifies a character constant, variable, or expression that replaces target.
data list; input salelist $; length target $10 replacement $3; target='FISH'; replacement='NIP'; salelist=transtrn(salelist,target,replacement); put salelist; datalines; CATFISH ;
'FISH '
in SALELIST.
Because the search fails, this line is written to the SAS log:CATFISH