I have column cust has character type and I want to change the type to numeric of the same variable.
data one;
set wes;
cust = input ( cust,best8.) ;
run;
But still, in the output, I am seeing the type of cust as a character which I am expecting to be numeric.
To change column type you have to assign it to a different column:\
data one;
set wes (rename = (cust = cust_char));
cust = input ( cust_char, best8.) ;
run;
Or even:
data one (drop = CUST_CHAR);
set WES (rename = (CUST = CUST_CHAR) );
CUST = input ( CUST_CHAR, best8.) ;
run;
> But still, in the output, I am seeing the type of cust as a character which I am expecting to be numeric.
Look at the log. Look at the log. Look at the log. Look at the log. Look at the log.
Always look at the log. Even if there are (you think) no errors.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.