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!
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.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
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!
Get started using SAS Studio to write, run and debug your SAS programs.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.