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
Define run-group processing?
Mention what is SAS data set?
What is the difference between %put and symbolgen? : sas-macro
what type of graphs we will create(for 2+years candidates)?
how could you generate test data with no input data? : Sas programming
Mention what is the difference between nodupkey and nodup options?
Explain proc univariate?
what is PhaseIII, ODS, TLG, Macro and Proc in SAS
do you prefer proc report or proc tabulate? Why? : Sas programming
Give e an example of..
explain the difference between proc means and proc summary?
what are input dataset and output dataset options? : Sas programming
What is slibref?
What are pdv and it functions?
what are the best practices to process the large data sets in sas programming? : Sas-administrator