Hi,
Can anyone help me converting from 125,804 to 125804.
2.53.476
253476
Thanks in advance
How is that a FORMAT issue?
Where are the existing values? Where do you want the converted values?
Do they have commas or periods in them? Or both?
If you have character variables why not just use COMPRESS()?
data have ;
input str $20. ;
cards;
125,804
2.53.476
253476
;
data want ;
set have ;
new = compress(str,',.');
run;
Obs str new 1 125,804 125804 2 2.53.476 253476 3 253476 253476
At least provide the current format the variable has and the variable name.
You can get that information from Proc Contents or table properties.
The example values you show indicate that the variable must be character as none of the SAS supplied formats would treat both comma and period as the thousands separator your example implies. So do you want an actual numeric value or a character value without the comma and period?
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.