How would you code a merge that will keep only the
observations that have matches from both sets?
Answers were Sorted based on User's Feedback
Answer / vijay
Dear Guest,
Merge won't accept NODUPKEY option. it is for PROC SORT.
the following code will get only matched observations in
both datasets
data three;merge one (in=a) two (in=b);by **;if a and b;run;
| Is This Answer Correct ? | 12 Yes | 0 No |
Answer / murray
Both answers #2 and #3 will work fine, however the '= 1'
part is superfluous, and will work fine without.
| Is This Answer Correct ? | 0 Yes | 3 No |
Answer / san
data c;
merge data a(in=a)
dat b(in=b);
if a=1 and b=1;
by<common column>;
run;
| Is This Answer Correct ? | 0 Yes | 5 No |
What are the statements in proc sql?
sas macros
what are all the ways to define macro variable??
2 Answers GSK GlaxoSmithKline,
Explain proc sort?
what is the difference between %put and symbolgen?
How do you put an elephant in the refrigerator?
what are input dataset and output dataset options?
How would you invoke a macro? : sas-macro
How to get top scorer student from a class-table having different sections A,B, C & D? Each section having same number of students.
how we can create optional or required parameters in SAS macro...
what are the categories that sas informats are used to the place the data? : Sas-administrator
What is the function of Stop statement in a SAS Program?