Exam A00-211 All QuestionsBrowse all questions from this 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?

    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
Mouni_18Option: C

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

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

Mandar77Option: B

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

Mandar77Option: C

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.

NavyvuyyuruOption: D

yes, the correct answer here is D

Navyvuyyuru

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

Navyvuyyuru

what is the correct answer here ?

KleinstoneOption: C

is C? D is surely wrong.