BookmarkSubscribeRSS Feed
kajal_30
Quartz | Level 8

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. 

 

3 REPLIES 3
SASKiwi
PROC Star

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;
ChrisNZ
Tourmaline | Level 20

Or even:

data one (drop = CUST_CHAR);
  set WES (rename = (CUST = CUST_CHAR) );
  CUST = input ( CUST_CHAR, best8.) ;
run;
ChrisNZ
Tourmaline | Level 20

> 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.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 997 views
  • 2 likes
  • 3 in conversation