BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
SAS_Girl1
Calcite | Level 5

Hi - 

 

I would like to get rid of these apostrophes from first and last names. 

 

Currently names appear as: 

"Martha" and I would want to and up with Martha 

 

Should be simple enough, 

Thank you, 

 

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

These are not apostrophes, those are double-quotes. So, do you want to remove single-quotes and double-quotes from the name?

 

If so, try this:

 

new_name=compress(name,'"');

 

to get rid of the double-quotes and if you also want to get rid of single-quotes, use one more command

 

new_name=compress(new_name,"'");

 

--
Paige Miller

View solution in original post

2 REPLIES 2
PaigeMiller
Diamond | Level 26

These are not apostrophes, those are double-quotes. So, do you want to remove single-quotes and double-quotes from the name?

 

If so, try this:

 

new_name=compress(name,'"');

 

to get rid of the double-quotes and if you also want to get rid of single-quotes, use one more command

 

new_name=compress(new_name,"'");

 

--
Paige Miller
SAS_Girl1
Calcite | Level 5

Thank you so much for the prompt reply! 

I will test your suggestions. 

Best,

 

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 748 views
  • 0 likes
  • 2 in conversation