Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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 are the ways to do a “table lookup” in sas?

1027


how does sas handle missing values in a merge? : Sas programming

1036


Explain what is data step?

1191


How many ways to overcome a missing values???

2805


what is star schema? : Sas-di

1123


Do we follow ADAM in analysis dataset development?How? Usually which version? Why is it necessary?

2402


How does proc sql work?

1071


What is the basic syntax style in SAS?

1157


Can you execute macro within another macro? : sas-macro

990


what is the difference between unique key and primary key? : Sas-di

1121


explain the proc in sas? : Sas-administrator

1083


what is operational data and operational system? : Sas-di

1102


how do you debug and test your sas programs? : Sas programming

1119


What is SAS? What are the functions does it performs?

1190


Describe the function and untility of the most difficult SAS macro that you have written.

2203