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 / aaa

PROC SORT DATA=COUNT_;
BY YEAR NAME;
RUN;

DATA TEST (DROP=VALUE);
SET COUNT_;
BY YEAR NAME;
RETAIN COUNT;
IF FIRST.NAME THEN COUNT = 0;
COUNT = COUNT + VALUE;
IF LAST.NAME THEN OUTPUT;
RUN;

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is scheduling and how will u implement it. In scheduling 5 jobs r running if there is an error occured at 3rd job and how will u check and waht necessary steps will u take not to repeat the same mistake

2419


What are the default statistics that proc means produce?

1086


what are the softwares and applications that are used most frequently used by sas bi applications developers? : Sas-bi

1061


which date function advances a date, time or datetime value by a given interval? : Sas programming

1097


What are the differences between sum function and using “+” operator?

1156


What is the purpose of trailing @ and @@? How do you use them?

1083


What does proc print, and proc contents are used for?

1217


how do you test for missing values? : Sas programming

1098


How to test the debugging in sas?

1243


What is PROC in SAS?

1102


Name few SAS functions?

1143


What are the data types does SAS contain?

1167


Why and when do you use proc sql?

1286


What do the put and input function do?

1110


what are the best practices to process the large data sets in sas programming? : Sas-administrator

1075