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 / karthik

data a;
input var;
cards;
0
1
2
3
-1
-2
-3
;
data report;
set a;
if var>=0 then var1=var;
else var2=var;
drop var;
run;
/*Report output*/
proc print data=report;
run;

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

explain the difference between proc means and proc summary?

655


name several ways to achieve efficiency in your program? : Sas programming

564


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

544


What is SAS informats?

625


How are numeric and character missing values represented internally?

1129






For clinical entire study how many tables will create approx?

1512


What is a pdv and what are its functions?

593


Have you ever used the SAS Debugger?

1201


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

673


How to limit decimal places for the variable using proc means?

587


what is slowly changing dimension? : Sas-di

611


Explain the main difference between the sas procedures and functions? : Sas-administrator

529


what are validation tools that are used in sas? : Sas-administrator

585


What are the statements in proc sql?

582


how does sas handle missing values in assignment statements? : Sas programming

563