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 / xxx
here i can write the code using PROC SQL;
plz ans in DATA STEP;
proc sql;
select year,name, sum(value)as T_value from count_ group by
year, name having sum(value) order by name;
quit;
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
how does sas handle missing values in: assignment statements, functions, a merge, an update, sort order, formats, procs? : Sas programming
Do we follow ADAM in analysis dataset development?How? Usually which version? Why is it necessary?
please can you tell me that in companies sas work are doing by through sas coding or sas wizard ??
What is the maximum length of the macro variable? : sas-macro
Can you execute macro within another macro? : sas-macro
what is the purpose of _error_? : Sas programming
explain about data integrator metadata reports? : Sas-di
what is data integration? : Sas-di
What is the difference between class statement and by statement in proc means?
What do the SAS log messages "numeric values have been converted to character" mean?
how can you import .csv file in to sas? : Sas programming
What would be the value of month at the end of data step execution and how many observations would be there?
I have a dataset concat having a variable a b & c. How to rename a b to e & f?
why is sas considered self-documenting? : Sas programming
What does the RUN statement do?