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

Define run-group processing?

581


Mention what is SAS data set?

677


What is the difference between %put and symbolgen? : sas-macro

671


what type of graphs we will create(for 2+years candidates)?

1906


how could you generate test data with no input data? : Sas programming

631






Mention what is the difference between nodupkey and nodup options?

596


Explain proc univariate?

606


what is PhaseIII, ODS, TLG, Macro and Proc in SAS

3907


do you prefer proc report or proc tabulate? Why? : Sas programming

575


Give e an example of..

1845


explain the difference between proc means and proc summary?

672


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

566


What is slibref?

746


What are pdv and it functions?

603


what are the best practices to process the large data sets in sas programming? : Sas-administrator

541