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 Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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
  • 603 views
  • 0 likes
  • 2 in conversation