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

what is program data vector? : Sas-administrator

1065


What do you know about symput and symget?

1222


Which command is used to perform sorting in sas program?

1043


what is factor analysis? : Sas-administrator

1085


Is the physical structure of the data set in the same orientation as the report? Do you need to reshape the data sets? What method should you use to reshape the data–DATA steps,PROC TRANSPOSE,output data set from a procedure?

2238


What are the data types in sas?

1052


What Proc glm does?

1076


I have a dataset concat having variable a b & c. How to rename a b to e & f?

1014


what are input dataset and output dataset options? : Sas programming

1094


How does proc sql work?

1071


What are the data types that sas contain?

1170


Explain the difference between using drop = data set option in set and data statement?

1150


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

1190


please can you tell me that in companies sas work are doing by through sas coding or sas wizard ??

2098


Mention common programming errors committed in sas ?

1111