Thursday, February 08, 2007

Creating Cumulative Totals

Here's how to update a SAS data set to include cumulative totals for a numeric variable.

In this example, he goal is to create a new variable ("sumT") that is a cumulative total of the variable tsippT:

data one;
input pulldate MMDDYY10.
tsippT 12-14
tsippC 15-18
count 20;
format pulldate date7.;
cards;
08/04/2006 34 24 1
09/25/2006 343 200 2
10/20/2006 678 398 3
11/03/2006 713 406 4
02/07/2007 857 451 5
;
run;

proc sort data=one;
by pulldate;
run;

data two;
set one;
by pulldate;
if first.count then sumT=0;
sumT+tsippT;
if last.pulldate;
run;

proc print data=two;
run;

50 Comments:

At 1:33 AM, Anonymous Allen Ziegenfus said...

Did you mean to write:

if first.pulldate then sumT = 0;

I am new to SAS, but I do not think first.count will never equal 1 since it is not in the by statement.

 
At 5:27 PM, Blogger Adole said...

I just tried this syntax and it did not work. It gave me the same numbers for each variable

 
At 4:21 AM, Anonymous Vincent Reduron (who never met the Rolling Stones) said...

Many thanks.

 
At 11:19 AM, Blogger  said...

情色tube情色文學情色偷窺情色偷拍情色偷拍自拍情色偷拍光碟情色光碟情色光碟線上試看情色光碟站情色光碟下載情色博物館情色卡提諾情色小說情色小說色情小說情色小說kiss104貼圖區kiss911貼圖kiss文學區貼圖區kiss台灣情色貼圖區kiss台灣貼圖區kiss貼圖網站kk免費貼圖片區ol制服貼圖ol美腿貼圖pchome貼圖免費直播貼圖網免費無碼自拍貼圖貼圖dvd貼圖sex貼圖女同志如何增加手淫的時間如何增加夫妻情趣如何增加夫妻性愛如何增加做愛情趣如何吃女人愛液如何取悅一個男人如何去做愛的篇如何去做愛如何勾起男人性慾如何加強男人性慾如何讓女性如何讓女友高潮如何能令陰莖更大如何達到成功如何達到高潮

 
At 10:35 AM, Blogger chat said...

青春一逝不復返,事業一失難有成。........................................

 
At 10:41 PM, Blogger way 2 satheesh said...

hi i have a small doubt..how to preload formats in proc sql;

like
data a;
input id sex;
cards;
101 1
102 1
;
run;
proc format ;
value gen

1="Male"
2="female"
;
run;

proc means data=a completetypes nway;
class sex/preloadfmt;
run;

like how to do this in proc sql

 
At 2:12 AM, Blogger deeksha said...

I want more information about this topic it is really interesting thanks for sharing this information.




informatica training in chennai

 
At 2:56 AM, Blogger Priya Tamil said...

Thank goodness someone is promoting quality content. I often struggle with myself: do I post something on my blog to post something, or wait to post something worth saying.
sas

 
At 3:20 AM, Blogger Dhiya L said...

thank you for sharing the nice article here for the cumulative totals. So please keep update like this with this site.

CCNA Training

 
At 4:09 AM, Blogger saki said...

great doing. and i happy to visit your blog to know about this wonderful information. thanks for sharing. keep updating.
sas Training in Chennai

 
At 7:19 AM, Blogger Priscilla said...

Thank you for taking the time to provide us with your valuable information. We strive

to provide our candidates with excellent care.As always, we appreciate your

confidence and trust in us..SAP Training in chennai

 
At 3:39 AM, Blogger Priscilla said...

Thank you for taking the time to provide us with your valuable information. We strive to provide our candidates with excellent care.As always, we appreciate your confidence and trust in us..SAP Training in chennai

 
At 5:35 AM, Blogger Nainika Joseph said...


Really very nice blog information for this one and more technical skills are improve,i like that kind of post.



SAP training in Chennai

 
At 3:49 AM, Blogger Aarini abhinav said...

It’s really amazing that we can record what our visitors do on our site. Thanks for sharing this awesome guide. I’m happy that I came across with your site this article is on point,thanks again and have a great day.

Microstrategy Training in Chennai

 
At 4:56 AM, Anonymous Maani kamili said...

Really, these quotes are the holistic approach towards mindfulness. In fact, all of your posts are. Proudly saying I’m getting fruitfulness out of it what you write and share. Thank you so much to both of you.

Digital marketing company in Chennai

 
At 5:57 AM, Blogger Abiya Carol said...

Wonderful bloggers like yourself who would positively reply encouraged me to be more open and engaging in commenting.So know it's helpful.

PPC Services in Chennai

 
At 11:38 PM, Blogger Sowmiya said...

It is really a wonderful blog and it contains many information issues and your ideas are really mind blowing thus it is really very good and enthusiastic too.

Online Reputation Management

 
At 2:35 AM, Anonymous Reeta said...

You did a great job.. Thanks a lot for sharing this useful informative post with us.. Keep on blogging like this informative post with us, to develop my career in the right way.

Branding Services in Chennai

 
At 2:36 AM, Anonymous Vincent said...

I love to read your post. This was still amazing. I gained more knowledge by reading your post. Thanks for providing us the useful information with us. Your blog is really helpful for me in attaining my knowledge in a right way.

Branding Services in Chennai

 
At 3:42 AM, Blogger Sathya G said...

this is really a very great blog. the information present in this blog will be very useful for us. thank you for sharing with us.
ROI Services in Chennai

 
At 6:03 AM, Blogger Sathya G said...

thank you for sharing such a nice and interesting blog with us. hope it might be much useful for us. keep on updating...
ROI Services in Chennai

 
At 2:33 AM, Blogger Abiya Carol said...

Great post!I am actually getting ready to across this information,i am very happy to this commands.Also great blog here with all of the valuable information you have.Well done,its a great knowledge.

Branding Services in Chennai

 
At 3:14 AM, Blogger Sathya G said...

the blog is very interesting and will be much useful for us. thank you for sharing the blog with us. please keep on updating.
ROI Services in Chennai

 
At 5:46 AM, Blogger Giri Mani 2 said...

This blog is having the general information. Got a creative work and this is very different one. We have to develop our creativity mind. This blog helps for this.
Thank you for this blog. this is very interesting and useful.
Digital Marketing Company in Chennai

 
At 12:15 AM, Blogger Sowmiya said...

Wow it is really wonderful and awesome thus it is very much useful for me to understand many concepts and helped me a lot. it is really explainable very well and i got more information from your blog.

Best Android Training Institute in Chennai

 
At 1:35 AM, Blogger deeksha said...

This idea is mind blowing. I think everyone should know such information like you have described on this post. Thank you for sharing this explanation.
Your final conclusion was good.

Best Informatica Training Institute in Chennai

 
At 3:03 AM, Blogger deeksha said...


i got some more information about this topic, it is really helpful for me thanks for sharing those information. i need more information about this concept.


Informatica Training in Chennai

 
At 5:26 AM, Blogger deeksha said...


i got some more information about this topic, it is really helpful for me thanks for sharing those information. i need more information about this concept.

Android Training in Chennai

 
At 5:28 AM, Blogger deeksha said...

This idea is mind blowing. I think everyone should know such information like you have described on this post. Thank you for sharing this explanation.


Android Training in Chennai

 
At 12:19 AM, Blogger Geethapriya said...

Provides great information about the concept.It helps an individual to gain knowledge on new techniques.Keep on giving this type of information.
SEO Training in Chennai

 
At 11:25 PM, Blogger Karthi Swetha said...

Really very nice blog information for this one and more technical skills are improve,i like that kind of post.


Best Java J2ee training institutes in chennai

 
At 5:05 AM, Blogger Sowmiya said...


This blog explains the details about changing the ways of doing that business. That is understand well and doing some different process. Provides he best output of others.

Informatica Training in Chennai

 
At 5:18 AM, Blogger Pricilla Prasanth said...

wow amazing post.The key points you mentioned here related to maintenance of car is really awesome.Checking all fluid levels,changing oil and of course the regular service of the car which is necessary to maintain our vehicle.Thank you for the information.

bike spa services in mumbai
house cleaning services in mumbai
car wash services in mumbai

 
At 2:11 AM, Blogger Shalini said...

It's interesting that many of the bloggers to helped clarify a few things for me as well as giving.Most of ideas can be nice content.The people to give them a good shake to get your point and across the command .

digital marketing company in chennai
seo company in chennai

 
At 5:47 AM, Blogger Pricilla Prasanth said...

wow amazing post.The key points you mentioned here related to maintenance of car is really awesome.Checking all fluid levels,changing oil and of course the regular service of the car which is necessary to maintain our vehicle.Thank you for the information.

car wash services in mumbai

 
At 12:25 AM, Anonymous Padhma` said...

Being new to the blogging world I feel like there is still so much to learn. Your tips helped to clarify a few things for me as well as giving..
Back to original

 
At 1:09 AM, Blogger Sathya G said...

Superb blog. I really enjoyed very much with this article here. Really its a amazing article I had ever read. I hope it will help a lot for all. Thank you so much for this amazing posts and please keep update like this excellent article.
Hadoop Training in Chennai


 
At 3:55 AM, Anonymous Priyatamil said...

Wow.. Thanks much for sharing.. My friend also recommended you so that i can have a helping hand to make my blog as effective as possible.
New Zealand education Consultants in Chennai | Study in Europe Consultants in Chennai | Study in Canada Education Consultants in Chennai

 
At 7:57 PM, Blogger bavana princy said...


This blog having the details of Processes running. The way of running is explained clearly. The content quality is really great. The full document is entirely amazing. Thank you very much for this blog.
SEO Company in India

 
At 4:12 AM, Blogger Evangeline Mitul said...

Excellent and very cool idea and the subject at the top of magnificence and I am happy to this post..Interesting post! Thanks for writing it. What's wrong with this kind of post exactly? It follows your previous guideline for post length as well as clarity..

Best Dental Clinic In Velachery

 
At 10:49 PM, Blogger sathya said...

Thank you for taking the time to provide us with your valuable information. We strive to provide our candidates with excellent care and we take your comments to heart.As always, we appreciate your confidence and trust in us.

MSBI Training in Chennai

 
At 5:45 AM, Anonymous mahalyasree said...

There are many interesting information included and i can easily understand all given information.I post something on my blog to post something, or wait to post something worth saying. Keep update more information....

Office Interiors in Chennai
Home Interior Decorators in Chennai

 
At 2:05 AM, Anonymous Alvinasarah said...

I’m sincerely suggesting your blog to all my friends… I’ve changed myself in many thing after reading your blog… Thanks and keep going.
Best Accountants Melbourne
Accountants Melbourne
Melbourne Accountants

 
At 10:27 PM, Blogger Lunameadow said...

This blog is the general information for the feature. You got a good work for these blog.We have a developing our creative content of this mind.Thank you for this blog. This for very interesting and useful.

Oracle Training in Chennai

 
At 2:51 AM, Blogger Karthi Keyan said...

very very amazing explaintion....many things gather about yourself...yes realy i enjoy it
seo company in Chennai

 
At 2:56 AM, Blogger Karthi Keyan said...

very very amazing explaintion....many things gather about yourself...yes realy i enjoy it
seo company in Chennai

 
At 12:09 AM, Blogger sandhosh said...

Interesting blog which attracted me more.Spend a worthful time.keep updating more.
Digital marketing company in Chennai

 
At 11:56 PM, Blogger Karthi Keyan said...

Interesting blog post.This blog shows that you have a great future as a content writer.waiting for more updates...
seo company in Chennai

 
At 9:38 PM, Blogger sandhosh said...

Interesting blog which attracted me more.Spend a worthful time.keep updating more.
Digital marketing company in Chennai

 
At 10:22 PM, Blogger sandhosh said...

superb.....blog is much interesting which engaged me more.Spend a worthful time.keep updating more.
SEO Company in India
SEO Services in India
SEO Companies in India
SEO Company India
SEO Services India
SEO Companies India

 

Post a Comment

<< Home