DATA Step, Macro, Functions and more

Summarising data

Not applicable
Posts: 0

Summarising data

I have a data set which has customer number and different balances for different dates.
For example the initial data set has:
Cust_1 100.00 1/1/2008
Cust_1 150.00 1/10/2008
Cust_1 125.00 1/11/2008

I want to create data set which has

Cust_1 375.00,
this data set has the sum of balances for each customer, how would one accomplish this.
Posts: 9,370

Re: Summarising data

Posted in reply to deleted_user
Several possibilities exist for creating summary data sets and summary reports. PROC SQL is one choice; PROC MEANS, PROC TABULATE, and PROC REPORT all have methods to produce summary reports and summary data sets. Each procedure has its own syntax...for example, PROC SQL has the CREATE TABLE statement; PROC MEANS has the OUTPUT statement; PROC TABULATE and PROC REPORT both have the OUT= option, as well as an ODS OUTPUT possibility for most of the above procedures.

There have been previous forum posts on the subject of summary reports and summary tables/datasets. In addiiton, the documentation on each of the procedures is quite thorough. If you can't find an example in the documentation that suits your needs, you might wish to contact Tech Support for more help.

Not applicable
Posts: 0

Re: Summarising data

Posted in reply to deleted_user
I hope the below code would do for u,and the temp dataset contains the answer which you requested.

proc report data=cust nowd out=temp;
column cust_no bal;
define cust_no/group noprint;
define bal/analysis sum noprint;
Ask a Question
Discussion stats
  • 2 replies
  • 2 in conversation