By admin | August 10, 2009

SAS Certified Base Programmer 50 Questions (42)

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;

2 comments | Add One

  1. admin - 08/10/2009 at 10:02 am

    D

  2. Crystal - 07/31/2012 at 2:12 pm

    who could tell me what meansthe “returns” is ? same means of “run” or “excute”?

Leave a Comment

Leave a Reply

Your email address will not be published.