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
what are the component of range? : Sas-bi
Describe a time when you were really stuck on a problem and how you solved it?
What are the differences between proc means and proc summary?
What is the command used to find missing values?
what is the use of proc sql? : Sas programming
How do you control the number of observations and/or variables read or written? Approximately what date is represented by the SAS date value of 730?
where are dashboard components are created and maintained? : Sas-bi
for whom is sas data integration studio designed? : Sas-di
Explain data step in SAS
what are informats in sas? : Sas-administrator
Mention what is the difference between nodupkey and nodup options?
what is the difference between nodup and nodupkey options? : Sas programming
How do dates work in SAS data?
Describe the ways in which you can create macro variables?
what is the use of proc contents and proc print in sas? : Sas-administrator