BookmarkSubscribeRSS Feed
analyst97725
Calcite | Level 5

I have data that looks like the following as a data set in SAS (goes on for multiple years):

 

DateDollar Amount
07/14/202050
07/14/202020
07/14/202010
07/15/202030
07/15/20205
07/15/202067

 

I want to sum the dollar amount for each date to return one summed amount for each date in a new table that looks like the following:

DateDollar Amount
07/14/202080
07/15/2020102

How do I create this new table?

1 REPLY 1
PeterClemmensen
Tourmaline | Level 20
data have;
input Date :mmddyy10. DollarAmount;
format Date mmddyy10.;
datalines;
07/14/2020 50
07/14/2020 20
07/14/2020 10
07/15/2020 30
07/15/2020 5
07/15/2020 67
;

proc summary data = have nway;
   class Date;
   var DollarAmount;
   output out = want(drop = _:) sum =;
run;

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

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
  • 297 views
  • 1 like
  • 2 in conversation