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

data new;

set tech ;
by year name;
if first.year or first.name then do;
sum=0;
end;
sum+value;
if last.year or last.name ;

run;

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Describe the function and untility of the most difficult SAS macro that you have written.

2109


what r the job openings SAS for fresher graduates !

2458


I have 3 years of work experience at a startup and recently got certified in Data Science with SAS. I need to know how to get into the analytics industry

1759


What is SAS? What are the functions does it performs?

1199


Enlist the syntax rules followed in sas statements.

1086


What are the ways in which macro variables can be created in sas programming?

1109


what are the component of range? : Sas-bi

1100


what is sas application server? : Sas-di

1079


how do the in= variables improve the capability of a merge? : Sas programming

1436


What is the different between functions and PROCs that calculate the same simple descriptive statistics?

1794


what is SAS OPTIMIZATION?

2298


What are the advantages of using sas?

1147


How substr function works in sas?

1223


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

1291


what is the difference between infile and input? : Sas-administrator

1144