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

Differences between where and if statement?

1031


what is change analysis in sas di ? : Sas-di

1000


What was the last computer book you purchased? Why?

2332


What is your favorite all time computer book? Why?

2460


how does sas handle missing values in sort order? : Sas programming

880


What are the best sas programming practices for handling very large datasets? : sas-grid-administration

976


what is the difference between calculating the 'mean' using the mean function and proc means? : Sas programming

1184


Will it bother you if the guy at the next desk times the frequency and duration of your bathroom or coffee breaks on the grounds that ?you are getting paid twice as much as he is??

2561


What is the difference between order and group variable in proc report?

1378


What does the RUN statement do?

1263


What are the different servers in sas? : sas-grid-administration

1017


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

1084


Mention what is the difference between nodupkey and nodup options?

969


what do you mean by data staging area? : Sas-di

1079


what is a method for assigning first.var and last.var to the by groupvariable on unsorted data? : Sas programming

972