## SAS Certified Base Programmer 50 Questions (34)

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

Work.Employeefname ageBruce 30 Dan 40Work.Salaryfname salaryBruce 25000 Bruce 35000 Dan 25000

The following merged SAS data set is generated:

Work.Empdatafname age totsalBruce 30 60000 Dan 40 25000

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

a.

```
```data work.empdata;
merge work.employee
work.salary;
by fname;
if first.fname then totsal=0;
totsal+salary;
if last.fname then output;
run;

b.

```
```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;

c.

```
```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;

d.

```
```data work.empdata;
merge work.employee
work.salary;
by fname;
if first.fname then total+salary;
run;

B