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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 603 views
  • 0 likes
  • 2 in conversation