SAS Certified Adv Programmer 50 Questions (8)
Given the following SAS data sets One and Two:
One
Num | Char1 |
1 | A |
2 | B |
4 | D |
Two
Num | Char2 |
2 | X |
3 | Y |
5 | V |
The following SAS program is submitted creating the output table Three:
data three; merge one (in=in1) two (in=in2); by num; if in2; run;
Three
Num | Char1 | Char2 |
2 | B | X |
3 | Y | |
5 | V |
Which of the following SQL programs creates an equivalent SAS data set Three?
a.
proc sql;
create table three as
select two.num, char1, char2
from one left join two
on one.num=two.num;
quit;
b.
proc sql;
create table three as
select two.num, char1, char2
from one right join two
on one.num=two.num;
quit;
c.
proc sql;
create table three as
select two.num, char1, char2
from one full join two
on one.num=two.num;
quit;
d.
proc sql;
create table three as
select two.num, char1, char2
from one, two
where one.num=two.num;
quit;
Topics:
SAS Adv Questions |
2 Comments »
B
B: matching row + non matching row from the right