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
Mention what are the data types does SAS contain?
Which statement does not perform automatic conversions in comparisons?
what is enterprise guide? What is the use of it? : Sas programming
What do the mod and int function do? : Sas programming
what are input dataset and output dataset options? : Sas programming
Mention sas system options to debug sas macros.
how do the in= variables improve the capability of a merge? : Sas programming
what is the difference between: x=a+b+c+d; and x=sum (of a, b, c ,d);? : Sas programming
How are numeric and character missing values represented internally?
How will you react when, while consulting a SAS documentation manual to get an answer to a problem, someone says hey, I thought you were supposed to know all that stuff already, and not have to look it up in a book?
What is the use of %include statement?
what is transformation in sas data integration? : Sas-di
What is a pdv and what are its functions?
How would you define the end of a macro? : sas-macro
Define run-group processing?