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 / reddy

data both left_only right_only;
merge dataset1(in=a) dataset2(in=b);
by variable;
if a and b then output both;
if a and not b then output left_only;
if b and not a then output right_only;
run;

i think these is the easy way of writing the code,if any
one nows other please specify.thanks!

Is This Answer Correct ?    11 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how to create the AE dataset by using SDTMIG specifications and SAP plan by using UNIX platform?

2518


what is program data vector? : Sas-administrator

825


what is snowflake schema? : Sas-di

899


Describe the function and untility of the most difficult SAS macro that you have written.

1843


Enlist the functions performed by sas.

867


Describe 5 ways to do a “table lookup” in SAS?

880


What is interleaving in SAS?

857


State the difference between INFORMAT and FORMAT ?

816


What is the function of Stop statement in a SAS Program?

889


How to create a permanent sas data set?

864


What does proc print, and proc contents are used for?

816


Explain how you can debug and test your SAS program?

753


What is the length assigned to the target variable by the scan function?

899


Describe a time when you were really stuck on a problem and how you solved it?

2310


Name any two sas spawners? : sas-grid-administration

773