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

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 907 views
  • 0 likes
  • 2 in conversation