DATA Step, Macro, Functions and more

Combining several variables

Frequent Learner
Posts: 1

Combining several variables

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??

Super User
Posts: 13,498

Re: Combining several variables

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;



does some of what you want.

Ask a Question
Discussion stats
  • 1 reply
  • 2 in conversation