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 are all the reports you generated in your recent project?
Hi all, If Anybody has Advance SAS Certification dumps??? Please share with me. Email: pramod.kalugade03@gmail.com
what is a method for assigning first.var and last.var to the by groupvariable on unsorted data? : Sas programming
how many display types available in sas bi dashboard? : Sas-bi
how does sas handle missing values in sort order? : Sas programming
What are the automatic variables for macro? : sas-macro
Explain the difference between informat and format with an example.
which date functions advances a date time or date/time value by a given interval? : Sas programming
Do you need to rearrange the order of the data for the report?
Explain the special input delimiters used in sas programming.
what is study design in while working with SAS? what are screening variables in SAS?
What do you code to create a macro? : sas-macro
what are the benefits of data integration? : Sas-di
What is program data vector (pdv) and what are its functions?