Question 8 :The SAS data sets Work.Employee and Work.Salary are shown below.

 Work.Employee

 fname age

 Bruce  30

 Dan    40

 Work.Salary

 fname salary

 Bruce  25000

 Bruce  35000

 Dan    25000

 The following merged SAS data set is generated:

 Work.Empdata

 fname age totsal

 Bruce  30   60000

 Dan    40   25000

 Which one of the following SAS programs created the merged data set?

  1. data work.empdata;

 merge work.employee

 work.salary;     by fname;     if first.fname then totsal=0;

 totsal+salary;     if last.fname then output; run;

  1. data work.empdata(drop=salary);

 merge work.employee

 work.salary;     by fname;

 if first.fname then totsal=0;     totsal+salary;    if last.fname then output; run;

  1. data work.empdata; merge work.employee

 work.salary(drop=salary);

 by fname;     if first.fname then total=0;     totsal+salary;    if last.fname then output; run;

  1. data work.empdata; merge work.employee

 work.salary;     by fname;    if first.fname then total+salary; run;

  1. a
  2. Get all Questions and Answer from here
  3. You need to have paid subscription to access all questions
  4. Thanks for considering SAS Certification Material

 Correct Answer : 2 Exp :  The MERGE and BY statements allow you to match-merge two or more SAS data sets. The BY statement creates two temporary variables, First.Fname and Last.Fname

 for BY group processing.

You can access to full explanation to question and answer from this page.