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 is substr function?
What commands are used in the case of including or excluding any specific variables in the data set?
Name types of category in which SAS Informats are placed?
what are system option ? give few examples ? what are dataset options and dataset statements ? if there is a keep option and keep statement ? which one is executed first ? Difference between a WHERE statement and IF statement ? what is the advantage of using WHERE statement option on the dataset ?
What is the general format of function in sas? : sas-grid-administration
how do the in= variables improve the capability of a merge? : Sas programming
what is pdv? how it is related to input buffer in sas?
what cause the "error: connect:" and "error in the libname statement" when there weren't any such problems?
what can you learn from the sas log when debugging? : Sas programming
Can Some one Explain How the Datasets from SAS can be loaded in to the MVS OS?
How are the analysis data sets structured?
for report generation which one you used proc report or data_null_?
3 Answers Accenture, Quintiles,