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 / arun kumar
proc sql;
create table arun as
select sum(case when var>=0 then var else . end) as num_p,
sum(case when var<0 then var else . end) as num_n
from a;
quit;
proc print;
run;
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What are the different types of sas functions?
what is intially documentation in sas?
what is the difference between floor and ceil functions in sas? : Sas-administrator
For clinical entire study how many tables will create approx?
How would you define the end of a macro? : sas-macro
In sas, what are the areas that you are most interested in? : sas-grid-administration
How do you delete duplicate observations in sas?
What will calendar procedure do?
Name and describe few sas character functions that are used for data cleaning in brief.
what is treatment emergent events and treatment emregent adverse event
What is the difference between class statement and by statement in proc means?
Why and when do you use proc sql?
How substr function works in sas?
If you have a dataset that contains 100 variables, but you need only five of those, what is the code to force SAS to use only those variables?
Explain the special input delimiters used in sas programming.