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
What does the trace option do?
what do the sas log messages "numeric values have been converted to character" mean? What are the implications? : Sas programming
I have a dataset concat having a variable a b & c. How to rename a b to e & f?
How many data types are there in SAS?
: and & modifiers.
what are sas bi dashboard components? : Sas-bi
How we can call macros with in data step? : sas-macro
What commands are used in the case of including or excluding any specific variables in the data set?
how do you want missing values handled? : Sas programming
what techniques and/or procs do you use for tables? : Sas programming
what is the difference between infile and input? : Sas-administrator
What are the five ways to do a table lookup in sas? : sas-grid-administration
how does sas handle missing values in a merge? : Sas programming
what is hierarchy flattening? : Sas-di
Describe crosslist option in tables statement?