Question 16 :Assume that SAS data sets Sasdata.Products and Sasdata.Sales both contain the Prod_ID variable.
Which of the following SAS DATA steps returns only exceptions or non matches?
a.
libname sasdata 'SAS-data-library';
data all;
merge sasdata.products
sasdata.sales;
by prod_id;
if ins=1 or inp=1; run;
b.
libname sasdata 'SAS-data-library';
data all;
merge sasdata.products(in=inp)
sasdata.sales(in=ins);
by prod_id;
if ins=1 and inp=1; run;
c.
libname sasdata 'SAS-data-library';
data all;
merge sasdata.products(in=inp)
sasdata.sales(in=ins);
by prod_id;
if ins=0 and inp=0; run;
d.
libname sasdata 'SAS-data-library';
data all;
merge sasdata.products(in=inp)
sasdata.sales(in=ins);
by prod_id;
if ins=0 or inp=0; run;
- a
- Get all Questions and Answer from here
- You need to have paid subscription to access all questions
- Thanks for considering SAS Certification Material
Correct Answer : 4
Exp : By default, DATA step match-merges combine all observations in all input data sets. To include only unmatched observations from your output data set, you can use the IN= data
set option to create and name a temporary variable that indicates whether the data set contributed to the current observations.
You can access to full explanation to question and answer from this page.