나루다루

SAS BASE Q65. cat & catx & !! 본문

문제풀이/기타

SAS BASE Q65. cat & catx & !!

나루다루 2018. 11. 2. 00:52
728x90
반응형

QUESTION NO: 65

The following SAS program is submitted:

data combine;

prefix='505';

middle='6465 ';

end='09090';

<insert statement here>;

run;

 

Which statement successfully completes the program so that TOTAL has a value of 505-6465-09090?

 

A. total = cat('-', prefix, middle, end);

B. total = catx('-', prefix, middle, end);

C. total = prefix !!'-'!! middle ''!!'-'!! end;

D. total = prefix!!'-'!! left(middle)!!'-'!! end;

 

 

Answer: B





# 문제 풀이

 - cat() : 괄호 안의 내용을 그대로 연결

  - cat('-', prefix, middle, end) : -5056465 09090


 - catx('구분자', ~) : 구분자로 연결. 문자열 내 끝에 있는 공백 제거

  - catx('-', prefix, middle, end) : 505-6465-09090

  cf) 만약 middle='64 65 '일 경우, catx('-', prefix, middle, end) : 505-64 65-09090


 - C) prefix !!'-'!! middle ''!!'-'!! end : 505-6465 - 09090

  - 6565 다음에 공백이 있으므로 정답이 될 수 없다.


 - !! = || : 문자를 연결



728x90
반응형

'문제풀이 > 기타' 카테고리의 다른 글

SAS BASE Q67. 문자형/숫자형 변수  (0) 2018.11.02
SAS BASE Q66. ods html  (0) 2018.11.02
SAS BASE Q64. keep  (0) 2018.11.02
SAS BASE Q63. first [수정]  (0) 2018.11.02
SAS BASE Q62. ??  (0) 2018.11.02
Comments