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
For a user to have access to a standard workspace server, is internal authentication alone is sufficient? : sas-grid-administration
In ARRAY processing, what does the DIM function do?
what is the Population you used in your project, is it ITT or PP?
Mention what is PROC in SAS?
which date function advances a date, time or datetime value by a given interval? : Sas programming
what are informats in sas? : Sas-administrator
why is sas data integration studio important? : Sas-di
what are the softwares and applications that are used most frequently used by sas bi applications developers? : Sas-bi
What is the use of divide function?
How might you use MOD and INT on numeric to mimic SUBSTR on character Strings?
what r the job openings SAS for fresher graduates !
For what purposes have you used sas macros? : sas-macro
What is the difference between reading data from an external file and reading data from an existing data set?
Explain the purpose of retain statement.
How would you code a macro statement to produce information on the sas log? This statement can be coded anywhere? : sas-macro