BookmarkSubscribeRSS Feed
deleted_user
Not applicable
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.
2 REPLIES 2
Cynthia_sas
SAS Super FREQ
Hi:
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.

cynthia
deleted_user
Not applicable
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;
run;

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 642 views
  • 0 likes
  • 2 in conversation