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 is sas metadata server? : Sas-di
What do the SAS log messages "numeric values have been converted to character" mean?
what is sas and what are the functions? : Sas-administrator
What is factor analysis?
How do you control the number of observations and/or variables read or written? Approximately what date is represented by the SAS date value of 730?
Enlist the syntax rules followed in sas statements.
What is the difference between the proc sql and data step?
What is the role of sas grid administrator? : sas-grid-administration
Hi, Does anybody has lastest SAS certification(base, adv., clinical)dumps,if anybody has please email me at mailtorajani76@gmail.com. Thanks
How do you control the number of observations and/or variables read or written?
How you can read the variables that you need?
how does sas handle missing values in sort order? : Sas programming
What makes sas stand out to be the best over other data analytics tools?
What is the command used to find missing values?
How do you test for missing values?