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

Can you explain the process of calendar?

1116


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

1111


Explain the main difference between the sas procedures and functions? : Sas-administrator

1072


What are the prime responsibilities of data integration administrator? : Sas-di

1071


How to read an input file in sas?

1144


What commands are used in the case of including or excluding any specific variables in the data set?

1097


How do you control the number of observations and/or variables read or written? Approximately what date is represented by the SAS date value of 730?

1674


What Proc glm does?

1088


what do the sas log messages "numeric values have been converted to character" mean? What are the implications? : Sas programming

1275


What is the role of sas grid administrator? : sas-grid-administration

1291


What will calendar procedure do?

1075


What do you know about symput and symget?

1251


If you have a dataset that contains 100 variables, but you need only five of those, what is the code to force SAS to use only those variables?

1165


how to do user inputs and command line arguments in sas?

3049


What are the parameters of scan function?

1177