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

What are types of transport files?

6864


what are sas/access and sas/connect? : Sas programming

548


What are the default statistics for means procedure?

644


What are the new features included in the new version of SAS Programming Language?

737


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

2262






what is transformation in sas data integration? : Sas-di

554


What is the difference between using drop = data set option in data statement and set statement?

638


What are the different servers in sas? : sas-grid-administration

600


Explain by-group processing?

589


Explain what is the use of proc gplot?

702


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

584


How many data types are there in SAS?

634


For what purposes have you used sas macros? : sas-macro

540


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

531


Explain the use of proc print and proc contents?

562