By admin | September 4, 2009

SAS Certified Base Programmer 123 Questions (19)

The SAS data sets WORK.EMPLOYEE and WORK.SALARY are shown below:

WORK.EMPLOYEE
fname age 
Bruce 30 
Dan   40 
WORK.SALARY
name salary
Bruce 25000
Bruce 35000
Dan   25000

The following SAS program is submitted:

data work.empdata;
    <insert MERGE statement here>
    by fname;
    totsal+ salary;
run;

Which one of the following statements completes the merge of the two data sets by the FNAME variable?

A.

merge work.employee
work.salary (fname = name);

B.

merge work.employee
work.salary (name = fname);

C.

merge work.employee
work.salary (rename = (fname = name));

D.

merge work.employee
work.salary (rename = (name = fname));

3 comments | Add One

  1. admin - 09/4/2009 at 12:54 pm

    D

  2. Deepak - 07/26/2011 at 1:58 pm

    All options are incorrect as SAS will generate errors:
    A. Invalid option name FNAME.
    B. Invalid option name NAME.
    C. BY variable FNAME is not on input data set WORK.SALARY.
    D. Variable NAME is not on file WORK.SALARY

  3. Sanitha - 03/10/2012 at 10:57 pm

    D is correct. NAME is renamed to FNAME before merging by the rename option.

Leave a Comment

Leave a Reply

Your email address will not be published. Required fields are marked *