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
What are types of transport files?
Briefly explain input and put function?
If you could design your ideal job, what would it look like?
what is the difference between infile and input? : Sas-administrator
How can sas program be validated?
what is sas enterprise intelligence architecture? : Sas-bi
how does sas handle missing values in procs? : Sas programming
How will you react when, while consulting a SAS documentation manual to get an answer to a problem, someone says hey, I thought you were supposed to know all that stuff already, and not have to look it up in a book?
How would you identify a macro variable? : sas-macro
What is the function of Stop statement in a SAS Program?
how many types prompting framework can be broken down to? : Sas-bi
Can you execute a macro within a macro? Describe. : sas-macro
how we can create a FLAG datasets? Ex:-ID age_group no_persons 1 to 10 10 to 20 3 11 to 20 21 to 30 7 21 to 3o 31 to 40 5
Explain data_null_?
how to generate the test data in sas without input data? : Sas-administrator