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

Will it bother you if the guy at the next desk times the frequency and duration of your bathroom or coffee breaks on the grounds that ?you are getting paid twice as much as he is??

2106


how to generate the test data in sas without input data? : Sas-administrator

591


What is the order of application for output data set options, input data set options and SAS statements?

1091


what is the primary data source for the wrs? : Sas-bi

667


Give some examples where proc report’s defaults are same as proc print’s defaults?

654






Differentiate input and infile.

604


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

2306


if a variable contain dates like "2015/01"---"2015/12" (yymm) ,How to add day to those dates,if them month is jan then 31 if the month is feb then 28 so on ...

955


Name validation tools used in SAS

706


Do we follow ADAM in analysis dataset development?How? Usually which version? Why is it necessary?

1923


I have 3 years of work experience at a startup and recently got certified in Data Science with SAS. I need to know how to get into the analytics industry

1333


What are the functions used for character handling?

652


Why double trailing @@ is used in input statement?

716


what other sas products have you used and consider yourself proficient in using? : Sas programming

693


What do you understand by the term Normal Distribution?

582