I have a numerical variable which takes values of varied lengths. I want to add a decimal point before two last two digits in each value. For Example if the original value in a row is 180000, the new value should be 1800.00, and if its 5676456, the new value should be 56764..56
How can I achieve this? Please help
Divide by 100 and use format 10.2 (or similar)
If you need to do this while reading from an external source, use a proper informat:
data want;
input number 10.2;
format number 10.2;
datalines;
180000
5676456
;
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.