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

Hi,

 

When I am importing a file into SAS the variable are being converted from numeric to character....This is probably because missing observations are represented with  "." .Is there anyway I can replace "." with a " " (that is a blank value). I know this can be simply done in excel but excel is also removing "'." from my numeric data set that is replacing :e.g 3.2756 to 32756. Any suggestions how to handle it? Please note that I have more than 6000 variables in my data set.

1 ACCEPTED SOLUTION

Accepted Solutions
2 REPLIES 2
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Right, I am just looking into my crystal ball, and yes, now I see your data and your process!  How are you importing the data, is it Excel by any chance.  That is often the cause of bad data, consider moving to a proper data format like CSV, or XML, and writing a proper import step to import the data correctly.  This "This is probably because missing observations are represented with  "."" should not matter, as SAS treats . as numeric, unless of course your using proc import or Excel (or even worse, both).

 

" I know this can be simply done in excel but excel is also removing "'." from my numeric data set that is replacing :e.g 3.2756 to 32756." - what does this mean?  What is the datafile you have, what format.  Opening in Excel does not help anyone, Excel has "functionality" which hides real data and shows it how it thinks you want to see it.  Try posting some test data in the form of a text file.

 

"Please note that I have more than 6000 variables" - that is a lot, anything more than a couple of hundred is a lot and will be a real pain to try to work with.  First step for me would be to remodel the data into a workable format (i.e. normalise it all down to a few variables and lots of observations.)

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