일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 #예시문제 #해설
- 김윤상 객경 정오표
- 코레일
- 토르마무
- 강웅
- 금강마신
- sas base
- 2024 부산교통공사 면접
- 산업인력공단 #산인공 #ncs #모듈형 #정오표
- 에듀윌 봉모
- 객경
- 천소소
- 객관식 경영학
- 부산교통공사
- 부교공
- 아비무쌍 #오존
- 무협
- 객관식 경영학 정오표
- 노경찬
- 아비무쌍
- 부교공 면접
- 김윤상
- 신입사원 채용
- Today
- Total
나루다루
SAS BASE Q51. 세미콜론(;) / 추가 문제 본문
QUESTION NO: 51
The following SAS program is submitted:
data work.retail;
cost = '20000';
total= .10* cost
run;
What is the result?
A. The value of the variable TOTAL in the output data set is 2000. No messages are written to the SAS log.
B. The value of the variable TOTAL in the output data set is 2000. A note that conversion has taken place is written to the SAS log.
C. The value of the variable TOTAL in the output data set is missing. An error message is written to the SAS log.
D. The variable TOTAL in the output data set has no value. The program fails to execute due to a syntax error.
Answer: C
# 문제 풀이
- total 구문 뒤에 세미콜론(;)이 없으므로 구문오류(syntax error)가 난다. 따라서 데이터가 생성되지 않는다.
- D번 보기는 데이터 셋이 만들어지지만 값이 존재하지 않는다는 말이기 때문에 정답이 아니다. -> 데이터 셋 생성이 안됨.
- 만약 세미콜론이 있다면 : cost는 문자형변수인데 total에서는 곱셈(숫자형)을 수행하고 있다. 이 경우 sas에서 자동으로 숫자로 인식하여 total값을 계산해준다. 다만 log에 error message가 뜬다.
'Study > SAS BASE' 카테고리의 다른 글
SAS BASE Q53. array & _temporary_ (0) | 2018.10.31 |
---|---|
SAS BASE Q52. data _null_ (0) | 2018.10.31 |
SAS BASE Q50. 문자형 변수 (0) | 2018.10.31 |
SAS BASE Q49. if문 (0) | 2018.10.31 |
SAS BASE Q48. select ~ when 구문 (0) | 2018.10.31 |