data np_summary_update; set pg1.np_summary; keep Reg ParkName DayVisits OtherLodging Acres SqMiles Camping; SqMiles=Acres*.0015625; Camping=sum(OtherCamping,TentCampers, RVCampers,BackcountryCampers); format SqMiles comma6. Camping comma10.; run; data np_summary_update; set pg1.np_summary; keep SqMiles Camping Reg ParkName DayVisits OtherLodging Acres ; *Add assignment statements; SqMiles=Acres *.0015625; Camping =sum(OtherCamping,TentCampers,RVCampers,BackcountryCampers); format SqMiles comma. Camping comma. run;
Welcome to the community.
Two things to get the best results:
1. To make the most of this community, learn how to use the tools.
For example, use the running man icon to post code. Your code is illegible as is.
2. To make the most of SAS, always refer to the documentation.
In this case, see https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/leforinforref/p0sad1pg4gsni3n1gbjue9fxzyhq.ht...
You'll see that if you omit to specify the length for this format, a value of 6 is used. Hence the identical displayed values.
Welcome to the community.
Two things to get the best results:
1. To make the most of this community, learn how to use the tools.
For example, use the running man icon to post code. Your code is illegible as is.
2. To make the most of SAS, always refer to the documentation.
In this case, see https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/leforinforref/p0sad1pg4gsni3n1gbjue9fxzyhq.ht...
You'll see that if you omit to specify the length for this format, a value of 6 is used. Hence the identical displayed values.
Every SAS supplied format will have the default setting for W, as in Commaw., the displayed width of the result in the format description in the help.
When you create custom formats with Proc Format you can specify a default display width as well.
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 lock in 2025 pricing—just $495!
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.