BookmarkSubscribeRSS Feed

SAS Ceritified Advanced Programmer 덤프 풀이 57-59

Started ‎06-15-2020 by
Modified ‎06-15-2020 by
Views 150

#57.

 

Given the following SAS data set ONE: 

 

57-1.png

 

The following SAS program in submitted:

 

SE22020030900165270.png

 

Which one of the following is the result when the program finishes execution?

 

 

 

 

 

풀이)

 

정의: CALL SYMPUT(“macro-variable”, value);

 

CALL SYMPUT은 매크로 언어로 다른 프로시저나 실행문에서 사용할 수 있게 합니다.

 

CALL SYMPUT으로

 

  1.  단일 변수 매크로 형태

 

  1.  조건문과 함께 사용

 

3.데이터로 매크로 변수 및 값 지정하기

 

를 할 수 있습니다. 

 

 

57번 문제에서 CALL SYMPUT(group, sum)은 < 3. 데이터로 매크로 변수와 값 >로 입력된 변수의 값들을 매크로 변수화 하였습니다.

 

CALL SYMPUT으로 변수 GROUP에 있는 데이터 A ,B, C가 매크로 명이 되었습니다.

 

각각의 매크로 변수에 765, 123, 564가 할당되었습니다.

 

그래서 답은 변수 C에 564가 할당 되있는다는 A가 정답. 

 

[코드]

  

SE22020030900174870.png

 

[결과]

 

SE22020030900182170.png

 

#58.

 

Given the following SAS data set ONE:

 

58-1.png

 

The following SAS program is submitted:

  

SE22020030900190370.png

 

Which one of the following reports is generated?

 

 

 

답) B (dump에 표기된 3행에 있는 USA-BOSTON-50은 잘못되었다.)

 

풀이)

 

PROC SQL을 사용해서 SQL의 문법을 사용합니다.

 

SELECT: 결과값에 country, city, total(visit의 sum) 변수

 

FROM one: 데이터를 one데이터에서 가져옵니다.

 

GROUP BY: country, city 변수를 기준으로 같은 데이터 값끼리 그룹화합니다.

 

ORDER BY: country, total(desc_내림차순) 기준으로 정렬합니다. 

[코드]

  

SE22020030900194670.png

 

[결과]

 

SE22020030900201570.png

 

#59.

 

Given the following SAS data sets ONE and TWO:

 

 59-1.png

 

The following SAS program is submitted creating the output table THREE:

 

59-2.png

 

Which one of the following SQL programs creates an equivalent SAS data set THREE:

 

답) A

 

풀이)

ONE table과 TWO table에는 NUM이라는 중복된 변수가 있습니다.

 

두개의 테이블을 결합하지만 중복되는 NUM 변수는 하나의 열로 통합한 결과값을 보여주려면

 

OUTER UNION이라는 집합 연산자에다 CORR을 사용하면 됩니다.

 

 

[코드] 

 

SE22020030900214270.png

 

[THREE table 결과]

 

SE22020030900220770.png

 

[CORR 없는 OUTER UNION(집합연산자)_CODE] 

 

SE22020030900223270.png

 

[CORR 없는 OUTER UNION(집합연산자)_THREE table결과]

 

SE22020030900225870.png

 

 

 

Version history
Last update:
‎06-15-2020 05:20 AM
Updated by:
Contributors

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

Article Labels
Article Tags