I'm working with biochemistry data, and in my data set the concentrations of different hormones are registrered as character variables with a comma as decimal separator instead of (the more international) period.
I want to change these character variables to numeric variables, and I have tried to use the INPUT function. This doesn't work - maybe because of the comma as decimal separator? Therefore, my questian is: how do I change the decimal separator from "," to ".", when the data is not even registrered as numeric? Maybe it is the format, that should be changed?
My variable is called T3_konc and have mostly data with 1 decimal (e.g. 1,3 and 5,8), but a few is "fail" or "hemolysis".
I have tried:
Data Thyroid_hormones_new;
Set Thyroid_hormones;
If T3_konc = ',' then T3_konc='.';
run;
This didn't work, maybe because the results are not just a comma - the comma is only the separator.
To change from character to numeric variable I have tried:
Data Thyroid_hormones;
T3_konc_n = input(T3_konc, best9.);
run;
Thank you!
> a comma as decimal separator instead of (the more international) period.
One might disagree; it's basically the English colonies plus Japan, Korea and and China using the decimal point.
Not unlike the side of the road used for driving (north America and China switched side).
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.