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?
- data work.empdata;
merge work.employee
work.salary; by fname; if first.fname then totsal=0;
totsal+salary; if last.fname then output; run;
- 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;
- 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;
- data work.empdata; merge work.employee
work.salary; by fname; if first.fname then total+salary; 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 : 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.