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

data data1 data2 data3;
merge left(in-a) right(in=b);
by subjid;
if a and b then output data1;
if a and not b then output data2;
if b and not a then output data3;
run;

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what are some problems you might encounter in processing missing values? In data steps? Arithmetic? Comparisons? Functions? Classifying data? : Sas programming

719


Explain what Proc glm does?

633


what is the one statement to set the criteria of data that can be coded in any step? : Sas programming

646


how we can create a FLAG datasets? Ex:-ID age_group no_persons 1 to 10 10 to 20 3 11 to 20 21 to 30 7 21 to 3o 31 to 40 5

1654


How would you identify a macro variable? : sas-macro

529






what are _numeric_ and _character_ and what do they do? : Sas programming

672


Where do you use proc means over proc freq?

558


what is treatment emergent events and treatment emregent adverse event

1937


What Proc glm does?

608


What is the purpose of trailing @ and @@? How do you use them?

607


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 makes sas stand out to be the best over other data analytics tools?

584


What are the features of base sas system?

609


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

592


What is the basic structure of the SAS base program?

684