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
To what type of programms have you used scratch macros?
How sas treats the dsd delimiters?
explain what is data set in sas? : Sas-administrator
How do you define proc in sas? : sas-grid-administration
What are the difference between the sas data step and sas procs?
Give an example where SAS fails to convert character value to numeric value automatically?
what is the different between functions and procs that calculate the same simple descriptive statistics? : Sas programming
how sas deals with business intelligence? : Sas-bi
what can you learn from the sas log when debugging? : Sas programming
What are the different versions of sas that you have used until now? : sas-grid-administration
I need level 2 to 5 sas using companies in india
what do the sas log messages "numeric values have been converted to character" mean? : Sas programming
What is the difference between order and group variable in proc report?
What is the purpose of _character_ and _numeric_?
what cause the "error: connect:" and "error in the libname statement" when there weren't any such problems?