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



How would you code a merge that will keep only the observations that have matches from both sets?..

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

How would you code a merge that will keep only the observations that have matches from both sets?..

Answer / naveen

data qqq;
merge aaa(in=a) bbb(in=b);
if a and b;
run;

Is This Answer Correct ?    1 Yes 0 No

How would you code a merge that will keep only the observations that have matches from both sets?..

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

How would you code a merge that will keep only the observations that have matches from both sets?..

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

How would you code a merge that will keep only the observations that have matches from both sets?..

Answer / guest

nodupkey option in the merge statement

Is This Answer Correct ?    0 Yes 8 No

Post New Answer

More SAS Interview Questions

what is sas metadata server? : Sas-di

0 Answers  


How do you debug and test your SAS programs?

0 Answers   Quintiles,


How do you define proc in sas? : sas-grid-administration

0 Answers  


Describe the ways in which you can create a macro variable?

0 Answers  


"What is the difference between proc sort nodup and proc sort nodupkey?"

2 Answers  






Hot to suppress characters from a given string?

4 Answers   CTS,


Where do you use proc means over proc freq?

0 Answers  


what is the function of catx syntax? : Sas-administrator

0 Answers  


If you?re not wanting any SAS output from a data step, how would you code the data statement to prevent SAS from producing a set?

1 Answers  


What is the difference between a PROC step and a DATA step?

14 Answers   Accenture, HSBC,


The Lion King is hosting an animal conference. All the animals in the world attend except one. Which animal does not attend?

6 Answers   Oracle,


What is Tabulate.?Why we use it.? Which type of output we get from Tabulate.?

3 Answers   TCS,


Categories