SAS Certified Advanced Programmer 덤프 풀이 83-85
A. It instructs SAS to name and store a specific index.
B. It instructs SAS to store an index in a particular location.
C. It instructs SAS to use a specific index for WHERE processing.
D. It instructs SAS to use any available index for WHERE processing.
[정답] C
[풀이]
IDXNAME= 옵션은 SAS가 특정 인덱스를 사용할 수 있도록 합니다. SAS 데이터셋에서 순차적으로 찾는 방법을 무시합니다.
+
인덱스(INDEX)는 보조파일입니다. 인덱스파일은 KEY 변수에 의해 순서대로 저장된 항목으로 구성됩니다.
SAS 데이터셋을 순차적으로 자료를 읽는데 이 과정이 오랜 시간이 소요됩니다. 그래서 특정 관측치를 직접 찾기 위해 인덱스를 사용합니다.
인덱스의 장점
[WORK.INTERNAT]
LOCATION SUM
===========
USA 30
EUR 40
%let LOC = Usa;
proc sql;
select *
from internat
where location = "&Loc";
quit;
Which one of the following is the result when the above code is executed on the above data set?
A. A report is generated with one destination.
B. No report is generated as the case of the compared values is different.
C. No report is generated as the case of the macro variable name is different.
D. A report is generated with the two original observations as the where clause does not work.
[정답] B
[풀이]
SAS MACRO를 직접 입력하기 위해서는,
%LET XXX=YYY; : 매크로 XXX가 YYY로 출력되는 매크로를 생성합니다.
매크로를 생성할 때는 %LET명령어를 통해 만듭니다. 반드시 %를 붙여야 매크로 칼럼 생성으로 인식합니다.
&XXX. :매크로 XXX를 출력합니다.
&명령어를 통해 %LET 명령어로 생성된 매크로 변수값을 불러올 수 있습니다. &명령어를 매크로 trigger(방아쇠)라고도 합니다.
모든 매크로는 &를 통해 불러옵니다.
%PUT &=XXX, : 매크로 출력값을 로그창을 통해 확인합니다.
%put은 표로 이뤄진 결과값을 출력하는게 아니라 로그 기록에 결과값을 출력하는 명령어입니다. 매크로 칼럼과 결과값을 로그창에서 확인할 수 있습니다.
매크로 LOC가 Usa로 출력되는 매크로를 생성했습니다.
&LOC로 매크로 LOC를 출력할려고 했지만 매크로 변수 값이 달라 출력하지 못하였습니다.
#85
ONE
SALARY
======
200
205
…
523
The following SAS program is submitted:
Proc sql;
Select *
from one
<insert WHERE expression here>;
quit;
The following output is desired:
SALARY
200
205
523
Which WHERE expression completes the program and generates the desired output?
A. Where salary ne missing
B. Where salary ne null
C. Where salary is not missing
D. Where salary is not
[정답] C
[풀이]
NOT 연산자: 조건을 부정할 때 사용되는 WHERE절의 키워드로, NOT 연산자는 말그대로 바로 뒤에 오는 조건을 부정하는 역할을 합니다. 때문에 단독으로는 사용이 불가합니다. 또한, 다른 연산자와는 달리 필터링 할 열의 뒤가 아닌 앞에 사용됩니다.
결측값이 존재하지 않은 결과값을 출력하고 싶기 때문에 WHERE절에 IS NOT MISSING을 붙였습니다.
+NE: not equal
+null: 존재하지 않는 값
+missing: 결측값
Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.
Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.