Hi,
I want to merge two data sets in the usual way, by a certain criterion, matching only the observations (by id) that are in both data sets. What I would like to know is how I might go about collecting the data that does not make it through, i.e. the "id's" that are in one but not the other. We would like to see both data sets for our study. This is what i've been trying:
data merged_data_set_i_want;
merge a (in=ina) b (in=inb);
by id;
if ina and inb then output;
else if ina and not inb then output;
else if inb and not ina then output;
run;
what i'd like is to end up with two data sets; the initial merge (the things that are in both), and the things that don't make it.
What do I try next?
I want to merge two data sets in the usual way, by a certain criterion, matching only the observations (by id) that are in both data sets. What I would like to know is how I might go about collecting the data that does not make it through, i.e. the "id's" that are in one but not the other. We would like to see both data sets for our study. This is what i've been trying:
data merged_data_set_i_want;
merge a (in=ina) b (in=inb);
by id;
if ina and inb then output;
else if ina and not inb then output;
else if inb and not ina then output;
run;
what i'd like is to end up with two data sets; the initial merge (the things that are in both), and the things that don't make it.
What do I try next?