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

what can you learn from the sas log when debugging? : Sas programming

606


what are 5 ways to perform a table lookup in sas? : Sas-administrator

759


what is the Population you used in your project, is it ITT or PP?

2179


What is interleaving in SAS?

668


What Proc glm does?

608






How to import multiple xls files into sas. Out of those files, how to get different values from a single variable and how to find number of rows per value type? We can do this using group by for one xls file with proc sql. Was wondering how I can achieve this for multiple files at the same time. Any ideas?

2381


What areas of SAS are you most interested in?

1062


how can you put a "trace" in your program? : Sas programming

575


How does SAS handle missing values in: assignment statements, functions, a merge, an update, sort order, formats, PROCs?

1096


How do dates work in sas?

639


Mention the difference between ceil and floor functions in sas?

644


In SAS explain which statement does not perform automatic conversions in comparisons?

797


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

2684


Give some ways by which you can define the variables to produce the summary report (using proc report)?

593


What would be the result of the following SAS function (given that 31 Dec, 2000 is Sunday)?

678