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.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1073 views
  • 0 likes
  • 2 in conversation