일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
- 김윤상
- 모듈형 #산인공 #산업인력공단 #ncs #예시문제 #해설
- 객관식 경영학 정오표
- 산업인력공단 #산인공 #ncs #모듈형 #정오표
- 강웅
- 신입사원 채용
- 금강마신
- 부교공 면접
- 부산교통공사
- 아비무쌍 #오존
- 아비무쌍
- 2024 부산교통공사 면접
- 김윤상 객경 정오표
- 무협
- 코레일
- 천소소
- 객관식 경영학
- 토르마무
- sas base
- 부교공
- 객경
- 에듀윌특별판
- 에듀윌 봉모
- 노경찬
- Today
- Total
나루다루
SAS BASE Q58. first/last & if 본문
QUESTION NO: 58
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 named WORK.SALARY contains 10 observations for each department, and is currently ordered by DEPARTMENT. Which statement is true?
A. The BY statement in the DATA step causes a syntax error.
B. The statement payroll +wagerate; in the DATA step causes a syntax error.
C. The values of the variable PAYROLL represent the total for each department in the WORK.SALARY data set.
D. The values of the variable PAYROLL represent a total for all values of WAGERATE in the WORK.SALARY data set.
Answer: C
# 문제 풀이
- first, last : 정렬이 돼야 사용 가능. data step 내에서만 존재 -> 출력 x
- first.department : department 내의 여러 범주의 변수들 중 범주의 각 첫번째 변수에 1을 할당하고, 나머지 변수에는 0을 할당.
- if 변수 <=> if 변수=1 : 변수=1을 만족하는 레코드 선택
- 노란색 부분만 출력된다. first와 last는 출력 x
- 범주의 마지막 payroll은 해당 범주의 총합을 나타낸다.
'Study > SAS BASE' 카테고리의 다른 글
SAS BASE Q60. @@ (???) (0) | 2018.11.01 |
---|---|
SAS BASE Q59. @ & informat [수정] ??? (0) | 2018.11.01 |
SAS BASE Q57. (0) | 2018.10.31 |
SAS BASE Q56. le & ge (0) | 2018.10.31 |
SAS BASE Q55. weekdate (0) | 2018.10.31 |