A00-211 Exam QuestionsBrowse all questions from this exam

A00-211 Exam - Question 8


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

WORK.EMPLOYEE WORK.SALARY -

fname age name salary

Bruce 30 Bruce 25000 -

Dan 40 Bruce 35000 -

Dan 25000 -

The following SAS program is submitted:

data work.empdata;

by fname;

totsal + salary;

run;

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

Show Answer
Correct Answer: C

To complete the merge of the two datasets by the FNAME variable, you need to account for the different names of the key variable in each dataset. In the WORK.EMPLOYEE dataset, the key variable is FNAME, while in the WORK.SALARY dataset, it is NAME. Thus, you should use the RENAME= data set option to standardize the key variable name before performing the merge. The correct syntax for this is 'merge work.employee work.salary (rename = (name = fname));'. This way, the NAME variable in WORK.SALARY is renamed to FNAME, allowing the datasets to be merged by the FNAME variable.

Discussion

6 comments
Sign in to comment
Mouni_18Option: C
Sep 11, 2023

The correct answer is data work.empdata; merge work.employee work.salary(rename=(name = fname)); by fname; run; It is not in these options. But it is close to option C so we can choose C.

Lisa_L
Dec 5, 2023

Agreed, the correct way to rename is (rename = (name = fname))

KleinstoneOption: C
Jan 19, 2021

is C? D is surely wrong.

Navyvuyyuru
Apr 21, 2021

what is the correct answer here ?

NavyvuyyuruOption: D
Apr 21, 2021

yes, the correct answer here is D

Navyvuyyuru
Apr 21, 2021

Sorry the correct answer is merge work.employee work.salary (rename = (name = fname));

Mandar77Option: C
Jun 9, 2022

Correct answer is C. You need more than one dataset two merge in first place. Salary has column as name and Employee has column has fname. Either dataset has to rename column. C is right bcaz it is rename column with proper syntax.

Mandar77Option: B
Jun 9, 2022

Correction.. Answer C is wrong bacaz Salary has column as Name not Fname. My Apology. it has to be like this merge work.employee (rename = (fname = name)) work.salary; or merge work.employee work.salary (rename = (name = fname));