2
votes

I am trying to convert a character column to numeric and I have tried using:

  • var=input(var,Best12.);
  • var=var*1;

Both of them returned character columns, and there is only 1 warning message:

"Character values have been converted to numeric values at the places given by: (Line):(Column). 7132:4".

Is there another what to do this conversion inside SAS?

(my apologies if this is trivial)

Thanks!

1

1 Answers

6
votes

What you're doing will work if you assign the result to a new variable:

data tmp;
    char='1';
run;

data tmp;
    set tmp;
    num=char*1;
run;

proc contents; run;