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-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!

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
  • 1112 views
  • 1 like
  • 3 in conversation