BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
desireatem
Pyrite | Level 9

I imported an excel data but all the numeric variables appears as character.

How do I change all the variables to numeric. They are more than 200.

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User
You can't control that from SAS, at least not easily. If this is one time, check the Excel file and make sure that if you test with isnumber() the fields return TRUE.

Otherwise, convert to CSV and write a data step to read the data.

View solution in original post

2 REPLIES 2
pink_poodle
Barite | Level 11

Please provide more information. What is the code? What is the structure of the data that you are importing? Which variables are character when they should be numeric?

Reeza
Super User
You can't control that from SAS, at least not easily. If this is one time, check the Excel file and make sure that if you test with isnumber() the fields return TRUE.

Otherwise, convert to CSV and write a data step to read the data.

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

How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 1816 views
  • 1 like
  • 3 in conversation