나루다루

SAS BASE Q69. first/last 본문

Study/SAS BASE

SAS BASE Q69. first/last

나루다루 2018. 11. 2. 01:27
728x90
반응형

QUESTION NO: 69

The following SAS program is submitted:

data work.total;

set work.salary(keep = department wagerate);

by department;

if first.department then payroll = 0;

payroll + wagerate;

if last.department

run;

 

The SAS data set WORK.SALARY, currently ordered by DEPARTMENT, contains 100 observations for each of 5 departments. What is the result?

 

A. The WORK.TOTAL data set contains 5 observations.

B. The WORK.TOTAL data set contains 100 observations.

C. The WORK.TOTAL data set contains 500 observations.

D. The program fails to execute due to errors.

 

 

Answer: A





# 문제 풀이

 - last.department=1인 항목만 표시한다. 각 department별로 마지막 변수만 표시되고, 5개의 변수가 있으므로 5개의 관측값이 출력된다.

728x90
반응형

'Study > SAS BASE' 카테고리의 다른 글

SAS BASE Q71. firstobs & obs  (0) 2018.11.02
SAS BASE Q70. find  (0) 2018.11.02
SAS BASE Q68. input @ (???)  (0) 2018.11.02
SAS BASE Q67. 문자형/숫자형 변수  (0) 2018.11.02
SAS BASE Q66. ods html  (0) 2018.11.02
Comments