The following SAS program is submitted:
proc sort data = work.employee;
by descending fname;
proc sort data = work.salary;
by descending fname;
data work.empdata;
merge work.employee
work.salary;
by fname;
run;
Why does the program rail to execute?
The following SAS program is submitted:
proc sort data = work.employee;
by descending fname;
proc sort data = work.salary;
by descending fname;
data work.empdata;
merge work.employee
work.salary;
by fname;
run;
Why does the program rail to execute?
The program fails to execute because the RUN statement was omitted after each of the SORT procedures. In SAS, each PROC or DATA step must be concluded with a RUN statement to execute properly. Without the RUN statement, SAS does not know to execute the PROC SORT steps before attempting to merge the data sets in the DATA step.
The Code appears to be correct syntactically, but there's a small issue with the MERGE statement. You should use the BY statement after the MERGE statement to specify the variables by which the datasets are merged.
Answer D is correct.