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 / proc sql

proc sql:
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 two.id,name,age,sex from one
right join two on one.id=two.id where one.id is null;
quit;

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the prime responsibilities of data integration administrator? : Sas-di

585


Explain the purpose of substr functions in sas programming.

561


do you need to know if there are any missing values? : Sas programming

544


How we can call macros with in data step? : sas-macro

609


Give some examples where proc report’s defaults are different than proc print’s defaults?

592






What is the sas data set? : sas-grid-administration

564


What is a method for assigning first.VAR and last.VAR to the BY group variable on unsorted data?

2004


How to read an input file in sas?

652


What is the difference between nodupkey and nodup options?

591


AE datasets names? how many types?

2072


How to specify variables to be processed by the freq procedure?

613


how would you determine the number of missing or nonmissing values in computations? : Sas programming

655


What is the use of the %include statement?

682


why a stop statement is needed for the point= option on a set statement?

623


for what purpose would you use the retain statement? : Sas programming

579