BookmarkSubscribeRSS Feed
tcg15d0
Calcite | Level 5

Hi

I have a data set with a variable named "State" so some of the entries are very long and multiple words like "North Carolina" and I am wondering how I can keep that variable word together.

 

Also I have a variable "Salary" with a dollar sign and a comma in it and I don't know how to read in that variable in as one numeric variable.

 

Thank you!

1 REPLY 1
Reeza
Super User

Make sure your data is well structured and has a delimiter. In a CSV file, the proper structure is to have the character variables quoted with comma's separating the values. If a field is numeric but has comma's it can be read in if enclosed in quotes. 

 

But...depending on your data there may be other ways. In fact, this sounds like class work and a question that gets asked on here incredibly regularly so if you search I'm sure you'll find the exact answer on here, possibly with your exact data if it's homework. 

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 1 reply
  • 1028 views
  • 0 likes
  • 2 in conversation