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


Please Help Members By Posting Answers For Below Questions

What is factor analysis?

651


what are informats in sas? : Sas-administrator

576


What is the different between functions and PROCs that calculate the same simple descriptive statistics?

1219


Give e an example of..

1642


Mention how to limit decimal places for the variable using proc means?

632






How to create list output for cross-tabulations in proc freq?

614


What are the special input delimiters used in SAS?

648


what are some problems you might encounter in processing missing values? In data steps? Arithmetic? Comparisons? Functions? Classifying data? : Sas programming

713


what other sas products have you used and consider yourself proficient in using? : Sas programming

673


What is the difference between proportion and average?

2746


what can you learn from the sas log when debugging? : Sas programming

600


Do you need to rearrange the order of the data for the report?

1825


how to read the variables in sas? : Sas-administrator

547


Approximately what date is represented by the SAS date value of 730?

736


Describe a time when you were really stuck on a problem and how you solved it?

2079