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.
Save the spreadsheet to a text (eg csv) file, import that, then take the data step found in the SAS log and adapt the variables in question to your needs.
Save the spreadsheet to a text (eg csv) file, import that, then take the data step found in the SAS log and adapt the variables in question to your needs.
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.)
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.