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 is the difference between SAS functions and procedures?
What do you know about sas data set?
What are the applications primarily used by business analyst? : Sas-bi
how can you put a "trace" in your program? : Sas programming
how can you import .csv file in to sas? : Sas programming
if you were told to create many records from one record, show how you would do this using array and with proc transpose? : Sas programming
what do the pad and dim functions do? : Sas programming
What is a macro routine?
What does proc print, and proc contents are used for?
What are the features of SAS?
Describe the ways in which you can create macro variables?
How to sort in descending order?
what do the sas log messages "numeric values have been converted to character" mean? What are the implications? : Sas programming
What are the different versions of sas that you have used until now? : sas-grid-administration
how does sas handle missing values in a merge? : Sas programming