BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
mmh
Obsidian | Level 7 mmh
Obsidian | Level 7

Hello,
I am a new SAS user.
I have the following table:

Company_IDShare_IDPrice
10010110
10010220
10010330
100201100
10030620
10030725


I want to add the rows by group and get the following output:

Company_IDPrice
100160
1002100
100345


Thank you in advance for your kind support!

 

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26
proc summary data=have nway;
    class company_id;
    var price;
    output out=want sum=;
run;
--
Paige Miller

View solution in original post

4 REPLIES 4
andreas_lds
Jade | Level 19

Do want to add the rows to the existing dataset or just the summary rows in a new dataset?

 

mmh
Obsidian | Level 7 mmh
Obsidian | Level 7
Thank you for asking!
I want a summary rows in a new dataset.
PaigeMiller
Diamond | Level 26
proc summary data=have nway;
    class company_id;
    var price;
    output out=want sum=;
run;
--
Paige Miller
mmh
Obsidian | Level 7 mmh
Obsidian | Level 7
Thank you so much Paige!
It works perfectly 🙂