how to add distinctly var variable values ex..
Data a;
input var;
datalines;
0
1
2
3
-1
-2
-3
;
run;
adding all +ve value in one varibale n do the same for -ve
too
Answer Posted / ravikumar marappan
data test;
input var;
retain sub;
retain ad;
if var < 0 then sub=sum(sub,var);
else ad=sum(ad,var);
datalines;
1
2
3
-1
-2
-3
;
run;
| Is This Answer Correct ? | 4 Yes | 2 No |
Post New Answer View All Answers
What are the ways to do a “table lookup” in sas?
how does sas handle missing values in a merge? : Sas programming
Explain what is data step?
How many ways to overcome a missing values???
what is star schema? : Sas-di
Do we follow ADAM in analysis dataset development?How? Usually which version? Why is it necessary?
How does proc sql work?
What is the basic syntax style in SAS?
Can you execute macro within another macro? : sas-macro
what is the difference between unique key and primary key? : Sas-di
explain the proc in sas? : Sas-administrator
what is operational data and operational system? : Sas-di
how do you debug and test your sas programs? : Sas programming
What is SAS? What are the functions does it performs?
Describe the function and untility of the most difficult SAS macro that you have written.