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

Describe a time when you were really stuck on a problem and how you solved it?

2550


How would you code a merge that will write the matches of both to one data set, the non-matches from the left-most data?

1099


Which command is used to perform sorting in sas program?

1047


explain the proc in sas? : Sas-administrator

1089


what is the use of proc sql? : Sas programming

1133


What is the order of application for output data set options, input data set options and SAS statements?

1561


for what purpose would you use the retain statement? : Sas programming

1096


What are the difference between the sas data step and sas procs?

1185


explain what is data set in sas? : Sas-administrator

992


What are SAS/ACCESS and SAS/CONNECT?

1149


What do the PUT and INPUT functions do?

1336


what is the primary data source for the wrs? : Sas-bi

1235


what is the difference between: x=a+b+c+d; and x=sum (of a, b, c ,d);? : Sas programming

1143


Name types of category in which SAS Informats are placed?

1147


Explain data_null_?

1057