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 is the difference between one to one merge and match merge? Give an example.
What is the purpose of trailing @ and @@? How do you use them?
Explain what Proc glm does?
What is the difference between nodupkey and nodup options?
explain the use of % includes a statement in sas? : Sas-administrator
For a user to have access to a standard workspace server, is internal authentication alone is sufficient? : sas-grid-administration
What are the uses of sas?
List down the reasons for choosing sas over other data analytics tools.
if the Id has more then two transcatiion then show the first observation, IF Id has only two observation then It show both the observation
What is the difference between reading data from an external file and reading data from an existing data set?
For clinical entire study how many tables will create approx?
Mention what is PROC in SAS?
explain the difference between alternate key, business key, foreign key, generated key, primary key, retained key and surrogate key ? : Sas-di
What is a pdv and what are its functions?
If you could design your ideal job, what would it look like?