BookmarkSubscribeRSS Feed

SAS Certified Advanced Programmer 덤프 풀이 83-85

Started ‎06-23-2020 by
Modified ‎06-23-2020 by
Views 261

SAS Certified Advanced Programmer 덤프 풀이 83-85

 

 

  1. Which one of the following is the purpose of the IDXNAME= data set option?

 

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 데이터셋을 순차적으로 자료를 읽는데 이 과정이 오랜 시간이 소요됩니다. 그래서 특정 관측치를 직접 찾기 위해 인덱스를 사용합니다.

인덱스의 장점

  1. WHERE statement: 작은 subset에 더 빠르게 접근하는 경우
  2. BY statement: 정렬된 순서로 관측치를 반환하는 경우
  3. KEY= 옵션을 사용한 SET statement: 테이블 조회(look up)하는 경우
  4. PROC SQL: 관측치를 조인하는 경우
  5. KEY = 옵션을 사용한 MODIFY statement: 관측치를 수정하는 경우

 

 

  1. Given the following SAS data set named WORK.INTERNAT:

[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를 직접 입력하기 위해서는,

SAS코리아_0-1592904076433.png

 

%LET XXX=YYY; : 매크로 XXX YYY로 출력되는 매크로를 생성합니다.

매크로를 생성할 때는 %LET명령어를 통해 만듭니다. 반드시 %를 붙여야 매크로 칼럼 생성으로 인식합니다.

 

&XXX. :매크로 XXX를 출력합니다.

&명령어를 통해 %LET 명령어로 생성된 매크로 변수값을 불러올 수 있습니다. &명령어를 매크로 trigger(방아쇠)라고도 합니다.

모든 매크로는 &를 통해 불러옵니다.

 

%PUT &=XXX, : 매크로 출력값을 로그창을 통해 확인합니다.

%put은 표로 이뤄진 결과값을 출력하는게 아니라 로그 기록에 결과값을 출력하는 명령어입니다. 매크로 칼럼과 결과값을 로그창에서 확인할 수 있습니다.

 

SAS코리아_1-1592904076434.png

 

매크로 LOC Usa로 출력되는 매크로를 생성했습니다.

SAS코리아_2-1592904076435.png

 

&LOC로 매크로 LOC를 출력할려고 했지만 매크로 변수 값이 달라 출력하지 못하였습니다.

 

 

#85

  1. Given the SAS dataset ONE:

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

[풀이]

SAS코리아_3-1592904076439.png

 

                   

SAS코리아_4-1592904076439.png

 

 

NOT 연산자: 조건을 부정할 때 사용되는 WHERE절의 키워드로, NOT 연산자는 말그대로 바로 뒤에 오는 조건을 부정하는 역할을 합니다. 때문에 단독으로는 사용이 불가합니다. 또한, 다른 연산자와는 달리 필터링 할 열의 뒤가 아닌 앞에 사용됩니다.

결측값이 존재하지 않은 결과값을 출력하고 싶기 때문에 WHERE절에 IS NOT MISSING을 붙였습니다.

+NE: not equal

+null: 존재하지 않는 값

+missing: 결측값

 

 

 

 

Version history
Last update:
‎06-23-2020 05:51 AM
Updated by:
Contributors

sas-innovate-white.png

Our biggest data and AI event of the year.

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.

 

Register now!

Article Labels
Article Tags