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
;
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: