I import many different data files into SAS. Some of the phone numbers have dashes, some do not. How can I remove the dashes from the phone numbers for all different data types? I get an error when I use COMPRESS on numeric data types. This is what I would like to do: proc sql; create table test as select COMPRESS(phone_number,'-') as PhoneNumber from MyTable ;quit; But this won't work when there isn't already a dash, because it's numeric. I tried converting it to a char first, but if the phone number is already a char, I can't do that either. I haven't found a good way to check if a field is numeric or char value yet, either. Otherwise something like this would work: select case when ISNUMERIC(phone_number) then phone_number else COMPRESS(phone_number,'-') end as PhoneNumber But obviously ISNUMERIC does not exist. Any ideas? Thanks for your help!
... View more