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 |
name the scheduler for scheduling job and explain the scheduler? : Sas-di
what is the difference between proc means and proc tabulate?
what is star schema? : Sas-di
how does sas handle missing values in: assignment statements, functions, a merge, an update, sort order, formats, procs? : Sas programming
what kind of variables are collected in AE dataset?
3 Answers Accenture, Quintiles, SAS,
Suppose there is a SAS dataset with following values - Parent Child A B B C D E F G G H H I and so on….. This goes onto 1000s of observations/rows. Now how do we identify from this dataset Grandparents and Grandchildrens ?
5 Answers American Express, Barclays,
How to get second top scorer student from a class- table having different sections A, B, C & D? each section has same number of student.
How could you generate test data with no input data?
tell me about use of arrays in sas
Name types of category in which SAS Informats are placed?
what are all the default values getting in PROC MEANS...???
How do you test for missing values?