How would you code a merge that will write the matches of
both to one data set, the non-matches from the left-most
data set to a second data set, and the non-matches of the
right-most data set to a third data set.
Answer Posted / m.sivakumar
proc sql;
create table sqln1 as select one.id,name,age,sex from one
inner join two on one.id=two.id;
create table sqln2 as select one.id,name,age,sex from one
left join two on one.id=two.id where two.id is null;
create table sqln3 as select coalesce(one.id,two.id)as
id,name,age,sex from one right join two on one.id=two.id
where one.id is null;
quit;
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How do you control the number of observations and/or variables read or written?
What are the different versions of sas that you have used until now? : sas-grid-administration
How to limit decimal places for variable using proc means?
What are the five ways to do a table lookup in sas? : sas-grid-administration
what are sas/access and sas/connect? : Sas programming
how can you import .csv file in to sas? : Sas programming
How will you use the WHO Drug Dictionary for Reporting Clinical Trials?
how does sas handle missing values in a merge? : Sas programming
What is the use of the %include statement?
what is scheduling and how will u implement it. In scheduling 5 jobs r running if there is an error occured at 3rd job and how will u check and waht necessary steps will u take not to repeat the same mistake
what do the sas log messages "numeric values have been converted to character" mean? : Sas programming
what is business intelligence? : Sas-bi
What do you understand by the term Normal Distribution?
Describe what are the different levels of administrative users in sas? : sas-grid-administration
Can you execute macro within another macro? : sas-macro