Hi, I am using SAS online for academics.
I am having trouble with proper interpretation of data when importing an excel file. When importing the file SAS will interpret some of the blank cells correctly as a missing value represented by a ".", but for others it will not interpret them as a missing value and will represent them with a blank space.
I can't really work out the difference between the ones it is interpreting as a blank and the ones it is interpreting as a "." in the excel spreadsheet.
Thanks.
Numerics are represented with a period when missing.
Characters are represented by a space when missing.
Run a PROC CONTENTS on the data set and that should align with what you're seeing.
Numerics are represented with a period when missing.
Characters are represented by a space when missing.
Run a PROC CONTENTS on the data set and that should align with what you're seeing.
Awesome, how do you tell SAS to change a certain variable from character to numeric?
Ideally you change it in the import step. Sadly that's very difficult to do when reading from an Excel file.
You our can use the PUT function to create new variables that are the type you need. SAS variable types can't be changed once assigned, so you create new variables instead. If you absolutely require the original variable names you can rename the variables in the next step or in a prior step.
Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.
Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.