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
Describe the ways in which you can create macro variables? : sas-macro
where are dashboard components are created and maintained? : Sas-bi
What are the functions used for character handling?
What is the role of unrestrictive users? : sas-grid-administration
how could you generate test data with no input data? : Sas programming
What are the five ways to do a table lookup in sas? : sas-grid-administration
what does the run statement do? : Sas programming
What is a method to debug and test your SAS program?
what is the difference between nodup and nodupkey options? : Sas programming
How can you limit the variables written to output dataset in data step?
how many types of prompts are there? : Sas-bi
Give some examples where proc report’s defaults are same as proc print’s defaults?
What is by-group processing?
what is sas and what are the functions? : Sas-administrator
How will you generate test data with no input data?