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 is the Population you used in your project, is it ITT or PP?
what is star schema? : Sas-di
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.
What is a macro routine?
Are you involved in writing the inferential analysis plan? Tables specfications?
hi tell be about pfizer? how to compare the work with other companies ? please tell me how to login and work also?
What are the parameters of scan function?
Difference between informat and format?
Explain how merging helps to combine data sets.
How to specify variables to be processed by the freq procedure?
what is the use of sas management console? : Sas-di
Mention the difference between ceil and floor functions in sas?
How do dates work in SAS data?
do you need to know if there are any missing values? : Sas programming
What is the difference between one to one merge and match merge? Give an example.