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 / vipin choudhary

Assume the common variable in both of the old datasets
is "name".
Data One two three;
merge old(in = in1) old1(in = in2);
by name;
if in1 and in2 then output one;
if in1 then output two;
if in1 = 0 and in2 = 1 then output three;
run

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

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

2004


hi tell be about pfizer? how to compare the work with other companies ? please tell me how to login and work also?

1660


explain the concepts and capabilities of business object? : Sas-bi

538


What is connection profile? : sas-grid-administration

644


What was the last computer book you purchased? Why?

1910






hi all, I need the SAS DI DUMP(A00 260) for attending the certification. if any one have, pls provide it.Please Email to vrpotluri@hotmail.com. Thanks - Ramana

4909


how sas deals with business intelligence? : Sas-bi

581


In sas, what are the areas that you are most interested in? : sas-grid-administration

636


Differentiate between sas functions and sas procedures.

637


If money were no object, what would you like to do?

2684


describe about metadata object? : Sas-di

621


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?

634


What do the put and input function do?

583


Briefly explain input and put function?

623


How you can read the variables that you need?

651