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 other SAS features do you use for error trapping and data validation?

3 Answers   Quintiles,


What are Dashboard reports?And significance of these in analysis?

1 Answers  


How do you read in the variables that you need?

5 Answers  


What is the function of Stop statement in a SAS Program?

0 Answers  


What are the advantages of using sas?

0 Answers  






Dear all, proc means data=dsn noprint completetypes; class trtmntgroup /preloadfmt; output out=tot n=n; format trtmntgroup trtf. ; by vstgrp descending severity; run; This is the code I used for AE table. I got the values without giving the variable ‘trtmntgroup(numeric)’ in var statement. And if I give the var statement for that variable i’m getting the same values.How is that possible? What is the difference between class and var statement? Could any one explain me how does proc means work at the back end. And what is the difference between _freq_ value and N value in proc means. Thanks and regards, Rajesh.

1 Answers  


how to import XTP files into SAS datasets?

1 Answers   Barclays, Institute For Plasma Research,


What is the maximum and minimum length of macro variable

0 Answers  


What is the registered Key word is sas????

2 Answers   TCS,


Are you involved in writing the inferential analysis plan? Tables specfications?

0 Answers   Wipro,


how does sas handle missing values in an update? : Sas programming

1 Answers  


what is difference in window SAS & Unix SAS.....how do define working environment in both???

1 Answers   JPMorgan Chase,


Categories