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
where to use sas business intelligence? : Sas-bi
How would you determine the number of missing or nonmissing values in computations?
how we can create a FLAG datasets? Ex:-ID age_group no_persons 1 to 10 10 to 20 3 11 to 20 21 to 30 7 21 to 3o 31 to 40 5
What is the purpose of _character_ and _numeric_?
hi tell be about pfizer? how to compare the work with other companies ? please tell me how to login and work also?
What are SAS/ACCESS and SAS/CONNECT?
Mention the difference between ceil and floor functions in sas?
How would you code a merge that will write the matches of both to one data set, the non-matches from the left-most data?
Mention few capabilities of sas framework.
What is the length assigned to the target variable by the scan function?
Describe the ways in which you can create a macro variable?
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
What do the put and input function do?
what is transformation in sas data integration? : Sas-di
what are informats in sas? : Sas-administrator