BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Sivila
Calcite | Level 5

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;

1 ACCEPTED SOLUTION

Accepted Solutions
ChrisNZ
Tourmaline | Level 20

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.

 

 

View solution in original post

2 REPLIES 2
ChrisNZ
Tourmaline | Level 20

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.

 

 

ballardw
Super User

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.

SAS Innovate 2025: Call for Content

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!

Submit your idea!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 419 views
  • 1 like
  • 3 in conversation