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. 

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

Develop Code with SAS Studio

Get started using SAS Studio to write, run and debug your SAS programs.

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