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 the use of divide function?

1009


Can you execute macro within another macro? If so, how would sas know where the current macro ended and the new one began? : sas-macro

1132


What do you know about sas data set?

1022


what is function of retain statment

1976


State the difference between INFORMAT and FORMAT ?

1039


Differentiate between ceil and floor functions.

1102


How do you connect the desktop application to metadata server? : sas-grid-administration

1029


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

1233


How would you define the end of a macro?

1039


what is the difference between floor and ceil functions in sas? : Sas-administrator

1188


What is the maximum and minimum length of macro variable

1166


For a user to have access to a standard workspace server, is internal authentication alone is sufficient? : sas-grid-administration

941


Explain the use of proc print and proc contents?

905


Mention some common errors that are usually committed in sas programming.

997


Explain substr function?

1030