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

Name few SAS functions?

879


What do the SAS log messages "numeric values have been converted to character" mean?

1109


what is the difference between nodup and nodupkey options? : Sas programming

866


what is SAS OPTIMIZATION?

2034


what is business intelligence? : Sas-bi

799


How will you use the WHO Drug Dictionary for Reporting Clinical Trials?

2101


Which statement does not perform automatic conversions in comparisons?

1450


how will you location sas platform applications available from web browser? : Sas-bi

804


what is intially documentation in sas?

4620


What commands are used in the case of including or excluding any specific variables in the data set?

828


What is the work of tranwrd function?

952


Tell e how how dealt with..

1969


How do you convert basic cube to transaction cube and transaction cube to basic cube?

2008


it will become easy if uuu provide website linkssss and list of consultanciessssss

1747


What does proc print, and proc contents are used for?

819