converting character to numeric (SAS)

sas
18,117

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;
Share:
18,117

Related videos on Youtube

Author by

jpsfer

Updated on June 04, 2022

Comments

  • jpsfer almost 2 years

    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!