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


Please Help Members By Posting Answers For Below Questions

how would you create a data set with 1 observation and 30 variables from a data set with 30 observations and 1 variable? : Sas programming

832


what are the softwares and applications that are used most frequently used by sas bi applications developers? : Sas-bi

548


what cause the "error: connect:" and "error in the libname statement" when there weren't any such problems?

1676


how does sas handle missing values in formats? : Sas programming

575


What are the limitations for memory allocation for SAS variables

925






What are the parameters of scan function?

613


explain what is factor analysis? : Sas-administrator

598


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

1651


Are you involved in writing the inferential analysis plan? Tables specifications?

3476


what is the difference between: x=a+b+c+d; and x=sum (of a, b, c ,d);? : Sas programming

603


What will calendar procedure do?

592


If a variable contains letters or special characters, can it be numeric data type?

757


How would you include common or reuse to be processed along with your statements?

1896


Explain what is SAS informats?

617


I have 3 years of work experience at a startup and recently got certified in Data Science with SAS. I need to know how to get into the analytics industry

1320