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.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.