SAS Crambible 11

Adios_Hosang·2022년 9월 30일
0

SAS crambible

목록 보기
11/20

Q11.

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 fail to execute?

A. The SORT procedures contain invalid syntax.
B. The merged data sets are not permanent SAS data sets.
C. The RUN statement was omitted alter each or the SORT procedures.
D. The data sets were not merged in the order by which they were sorted.

답은 D입니다.

프로그램 수행 시 왜 오류가 나는가를 묻는 문제입니다.
이 문제를 풀기 위해선 merge의 가장 중요한 특성을 숙지하셔야 합니다.
merge 구문을 수행하기 위해선, dataset이 merge 구문에서 수행할려는 것처럼 정렬이 되어 있어야 합니다.

위의 두 데이터셋은 fname을 기준으로 내림차순 정렬이 되어 있습니다.
반면, merge 구문에서는 오름차순으로 정렬된 fanme 기준으로 수행하려고 하죠.
즉, 두 데이터셋의 정렬과 merge 구문의 정렬 기준이 일치하지 않으므로 오류가 발생합니다.
따라서, 답은 D입니다.

profile
IT를 시작하고자 합니다

0개의 댓글