how to write code for left outer join in SAs using datastep?
Answer Posted / venkatesh
if you use x=1 and y=0
you must use set statement also
try this
data a b;
merge one two;
by id;
if x=1 and y=1 then output a;
if x=1 and y=0 then output b;
data new;
set a b;
run;
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What are the 3 components in sas programming?
Tell me more about the parameters in macro? : sas-macro
What is the differnce between SDTM 3.1.2 to 3.1.1 version
what are some good sas programming practices for processing very large data sets? : Sas programming
What is a method to debug and test your SAS program?
Briefly explain input and put function?
Describe a time when you were really stuck on a problem and how you solved it?
please can you tell me that in companies sas work are doing by through sas coding or sas wizard ??
Explain append procedure?
What are the difference between the sas data step and sas procs?
What are the ways to do a “table lookup” in sas?
data data1; input dt account; format dt date9.; cards; 1745 1230 1756 1120 1788 1130 1767 1240 ; data data2; input startdt enddt total; format startdt date9. enddt date9.; cards; 1657 1834 12300 1557 1758 16800 1789 1789 12300 1788 1345 12383 1899 1899 13250 ; proc sql; create table data3 as select * from data1 as x left join data2 as y on x.dt>=y.startdt and x.dt<=y.enddt; quit; Here, we are getting cartision product. But,I want left join report consisting of this program. It should not get duplicate values. you can modify the program also.
For what purpose would you use the RETAIN statement?
what is sas application server, database server, sas olap server and sas metadata server? : Sas-di
What are the default statistics for means procedure?