I'm trying to work with manually inserted strings in SAS and I need to remove specific special characters (maybe by inserting a list of them) without removing blank spaces between words.
I've found a possible solution with a combination of compbl
and transtrn
to remove special characters and substitute them with blanks, reduced to one by compbl
but this requires multiple steps.
I'm wondering if there is a function that allows me to do this in a single step. I've tried with the compress function (with the 'k' modifier to keep only letters and digits) but it removes blanks between words.
I'd like to go from a string like this one:
O'()n?e /, ^P.iece
To:
One Piece
With a single blank between the two words.
If someone can help me it would be awesome!