BookmarkSubscribeRSS Feed
bryn
Calcite | Level 5

So I have merged together 2 data sets by the same last name. I now have several observation with the same last name. I want to combine all those variables(all with the same information in the other variables, just not in sales. I want to sum up all of the sales variables for each last name. 

 

Any idea of how to do this??

1 REPLY 1
ballardw
Super User

It would be helpful to see some example data and desired output.

 

It may be that something like

 

proc means data=yourdata sum;

    class lastname;

    var sales;

run;

 

does some of what you want.

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
  • 1 reply
  • 815 views
  • 0 likes
  • 2 in conversation