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 / ravikumar marappan
data test;
input var;
retain sub;
retain ad;
if var < 0 then sub=sum(sub,var);
else ad=sum(ad,var);
datalines;
1
2
3
-1
-2
-3
;
run;
| Is This Answer Correct ? | 4 Yes | 2 No |
Post New Answer View All Answers
Compare sas with other data analytics tools.
what is the difference between infile and input? : Sas-administrator
what is sas database server? : Sas-di
how to read the variables in sas? : Sas-administrator
what is change analysis in sas di ? : Sas-di
How does the internal authentication work in sas? : sas-grid-administration
What does P-value signify about the statistical data?
what is data access? : Sas-di
why is sas considered self-documenting? : Sas programming
What do you know about sas and what we do? : sas-grid-administration
How will you use the WHO Drug Dictionary for Reporting Clinical Trials?
hi all, I need the SAS DI DUMP(A00 260) for attending the certification. if any one have, pls provide it.Please Email to vrpotluri@hotmail.com. Thanks - Ramana
for what purpose would you use the retain statement? : Sas programming
Hi,by usining ptf how we have to combine (likr merge)10 datasets at a time in the oracle database(and write a macro code also)?Like this i have a douts a lot if you dont mind may please send one text mail for me(madhusudhanap16@gmail.com)?
How would you include common or reuse to be processed along with your statements?