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 types of transport files?
what are sas/access and sas/connect? : Sas programming
What are the default statistics for means procedure?
What are the new features included in the new version of SAS Programming Language?
I am preparing SAS Certified Advanced Programmer for SAS 9 in 2014. If anybody has the latest dumps for this exam, please mail me at dhiman.mukherjee@gmail.com
what is transformation in sas data integration? : Sas-di
What is the difference between using drop = data set option in data statement and set statement?
What are the different servers in sas? : sas-grid-administration
Explain by-group processing?
Explain what is the use of proc gplot?
What is auto call macro and how to create a auto call macro? What is the use of it? How to use it in sas with macros? : sas-macro
How many data types are there in SAS?
For what purposes have you used sas macros? : sas-macro
Can you execute macro within another macro? : sas-macro
Explain the use of proc print and proc contents?