I have a dataset with one id column and three character variables: data have;
input id var1 $ var2 $ var3 $;
datalines;
1 * 1.2 *
2 * 3.7 0.3
3 0.7 * 2
4 4.9 4.0 1.8
;
run; For each of the character variable, I want to replace the '*' character with a string that is specific to the variable. For example, in var1 '*' would be replace by '2', then in var2 '*' would be replaced by '4.5', etc... And then I would like to turn these variables to numeric. Is there a way of doing this using a "reference" table with the replacement values ? For example with a table like this one: data reference;
input var1 $ var2 $ var3 $;
datalines;
2 4.5 17
;
run;
... View more