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

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. 

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

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.

View solution in original post

3 REPLIES 3
Reeza
Super User

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.

RahulM
Fluorite | Level 6

Awesome, how do you tell SAS to change a certain variable from character to numeric? 

Reeza
Super User

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. 

sas-innovate-2024.png

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.

 

Register now!

How to Concatenate Values

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.

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
  • 3 replies
  • 892 views
  • 0 likes
  • 2 in conversation