I have an SAS dataset that has $'s in with some of the columns. So instead of reading 67,349 it reads $67,349. How do I remove all the $'s from all the columns and have SAS recognize them as numbers?
There are only a few columns with the dollar signs so I can do each column one at a time. I am using the free university edition of SAS.
If you just want to remove the $ and still have a character variable then use the compress()
function.
data want;
set have;
myvar = compress(myvar,'$');
run;
If you want to convert the character string to a new numeric variable then see this existing question. The COMMA.
informat will automatically ignore the $
and ,
characters in the string. Converting character variabls to numeric in SAS
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With