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

What is the purpose of _character_ and _numeric_?

1108


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

1145


Did you used proc test? when?

2088


if the Id has more then two transcatiion then show the first observation, IF Id has only two observation then It show both the observation

1657


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

1815


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

978


Explain input and put function?

1186


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

1314


How long can a macro variable be? A token? : sas-macro

1264


AE datasets names? how many types?

2559


How to specify variables to be processed by the freq procedure?

1117


how we can create a FLAG datasets? Ex:-ID age_group no_persons 1 to 10 10 to 20 3 11 to 20 21 to 30 7 21 to 3o 31 to 40 5

2152


what is transformation in sas data integration? : Sas-di

1082


how many display types available in sas bi dashboard? : Sas-bi

1141


What are the statements that are executed only?

1208