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

what is star schema? : Sas-di

842


What is the work of tranwrd function?

942


what is scheduling and how will u implement it. In scheduling 5 jobs r running if there is an error occured at 3rd job and how will u check and waht necessary steps will u take not to repeat the same mistake

2106


Explain by-group processing?

784


What is the use of function Proc summary?

888


What do you understand by the term Normal Distribution?

757


How substr function works in sas?

886


Have you ever used the SAS Debugger?

1457


what is function of retain statment

1781


Explain what Proc glm does?

830


What are pdv and it functions?

768


What is the maximum and minimum length of macro variable

908


How to include or exclude specific variables in a data set?

866


How do you convert basic cube to transaction cube and transaction cube to basic cube?

1990


Give some examples where proc report’s defaults are same as proc print’s defaults?

878