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 / ravi s

it need two steps

step 1 : proc sort; by year name;run;

Step 2: data total (drop = value);
set count_;
by year name;
if first.name then T_value =0 ;
T_value + value;
if last.name then output ;
run;

Note: Hence i am doing work in data step. i need to sort
the data first by using "Proc Sort".

Kindly let me know is the any other method to do?

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

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??

2615


how do you want missing values handled? : Sas programming

959


what are the new features included in the new version of sas i.e., Sas 9.1.3? : Sas programming

1080


How do you specify the number of iterations and specific condition within a single do loop?

1106


What are the special input delimiters used in SAS?

1183


How would you identify a macro variable?

1093


what is sas application server, database server, sas olap server and sas metadata server? : Sas-di

1016


What are the data types does SAS contain?

1117


Mention what is PROC in SAS?

1059


Describe the ways in which you can create a macro variable?

1084


is data integration and etl programming is same? : Sas-di

1084


How do you use the do loop if you don’t know how many times you should execute the do loop?

1262


What do you understand by the term Normal Distribution?

990


explain about sas business intelligence? : Sas-bi

1146


Describe the ways in which you can create macro variables? : sas-macro

1067