Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

calculate the sum of value using only DATA STEP.
data count_;
input year name $ value;
cards;
2006 xxx 10
2007 yyy 12
2006 xxx 20
2008 yyy 15
2007 xxx 15
;

out put should be like this
year name T_value
-----------------------
2006 xxx 30
2007 xxx 15
2007 yyy 12
2008 xxx 15

Answer Posted / nani

proc sort data=a;
by year ;
run;

data total ;
set a;
retain T_value;
by year ;
if first.year then T_value =0 ;
T_value + value;
if last.year then output ;
run;

proc print ;
run;

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to sort in descending order?

1248


What is SAS informats?

1095


explain the key concept of sas? : Sas-administrator

985


Compare sas with other data analytics tools.

1021


Enlist the functions performed by sas.

1114


What is a put statement?

1192


WHAT IS SAS WEB SERVICE and what are the steps to create an xml service ?

2788


What is the use of function Proc summary?

1271


Difference between informat and format?

1083


How you are maintaining sas programmes in your company...any specific version control software you are using? If so, tell me the name?

2114


how many types of prompts are there? : Sas-bi

1071


Hi, Does anybody has lastest SAS certification(base, adv., clinical)dumps,if anybody has please email me at mailtorajani76@gmail.com. Thanks

2240


What are the limitations for memory allocation for SAS variables

1476


how to generate the test data in sas without input data? : Sas-administrator

1120


What is the difference between order and group variable in proc report?

1424