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
Explain the difference between informat and format with an example.
how many types prompting framework can be broken down to? : Sas-bi
Explain bmdp procedure?
What is substr function?
How to limit decimal places for variable using proc means?
How to test the debugging in sas?
Mention the difference between ceil and floor functions in sas?
What was the last computer book you purchased? Why?
What is a method for assigning first.VAR and last.VAR to the BY group variable on unsorted data?
How to sort in descending order?
what has been your most common programming mistake? : Sas programming
Describe the ways in which you can create macro variables? : sas-macro
how to do user inputs and command line arguments in sas?
Mention what is the difference between nodupkey and nodup options?
What is the difference between where and if statement?