SAS Certified Base Programmer 123 Questions (19)
The SAS data sets WORK.EMPLOYEE and WORK.SALARY are shown below:
WORK.EMPLOYEE fname age Bruce 30 Dan 40
WORK.SALARY name salary Bruce 25000 Bruce 35000 Dan 25000
The following SAS program is submitted:
data work.empdata; <insert MERGE statement here> by fname; totsal+ salary; run;
Which one of the following statements completes the merge of the two data sets by the FNAME variable?
A.
merge work.employee
work.salary (fname = name);
B.
merge work.employee
work.salary (name = fname);
C.
merge work.employee
work.salary (rename = (fname = name));
D.
merge work.employee
work.salary (rename = (name = fname));
Topics:
SAS Base Questions |
3 Comments »
D
All options are incorrect as SAS will generate errors:
A. Invalid option name FNAME.
B. Invalid option name NAME.
C. BY variable FNAME is not on input data set WORK.SALARY.
D. Variable NAME is not on file WORK.SALARY
D is correct. NAME is renamed to FNAME before merging by the rename option.