jpsfer
jpsfer

Reputation: 594

converting character to numeric (SAS)

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

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!

Upvotes: 2

Views: 19093

Answers (1)

itzy
itzy

Reputation: 11765

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;

Upvotes: 6

Related Questions