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 🙂

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 486 views
  • 1 like
  • 3 in conversation