Hello. I have a question on format in SAS. Below is my code
Removed
correction_am is format numeric 8. How do I change this to Comma10.2 or Dollar10.2 in SAS in data step or proc sql code? I have tried various methods that did not work.
I have tried below code which worked but did not retain the two decimal places.
Removed
Try this:
proc sql;
create table OUT.FIN_POP_4a as
select sum(CORR_AM) as correction_am format=dollar10.2
from OUT.FIN_POP_4
;
quit;
Hey I tried that and it did not format with commas:
RemovedI want:
Removed
@user112a2 wrote:
Hey I tried that and it did not format with commas:
2084608.44
I want:
2,084,608.44 or $2,084,608.44
You need count the commas (and dollar sign) when setting the width.
1234567890123456 2084608.44 $2,084,608.44
Try DOLLAR13.2 or increase the width even more if your values can be larger than $9,999,999,99
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and save with the early bird rate—just $795!
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.