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 the command used to find missing values?

0 Answers  


how to generate means for every subject;

4 Answers   Mind Tree,


List down the reasons for choosing sas over other data analytics tools.

0 Answers  


what are validation tools that are used in sas? : Sas-administrator

0 Answers  


Can we use where and having clauses in a single SAS program. ex: proc sql;     select a,b,c from test      where state in 'KA'      and having <some condition>. Is the above program run correctly, if not why ?     

4 Answers   UHG,






what is slowly changing dimension? : Sas-di

0 Answers  


where will go the observations that were deleted by delete statement?

2 Answers  


Hi Jeevan/Akshara I have tried to contact SASI Vats for latest Advanced SAS Programming Certification Dumps (A00-212) but have not got any response. I would highly and gratefully appreciate your assistance in this regard. If you guys have access to this, would you be kind enough to forward it to me ? I would abide by all the terms you have for this. Please, note my email id: upretigopi@yahoo.com Preti Sharma

0 Answers  


What are the data types does SAS contain?

0 Answers  


Have you ever linked SAS code? If so, describe the link and any required statements used to either process the code or the step itself.

2 Answers   Accenture,


What is Transaction...? And what are Comment, Roll back n Save point..?

2 Answers  


How do you add a number to a macro variable?

2 Answers  


Categories