SAS Crambible 18

Adios_Hosang·2022년 9월 30일
0

SAS crambible

목록 보기
18/20

Q18.

The SAS data set PETS is sorted by the variables TYPE and BREED.

The following SAS program is submitted:

proc print data = pets;
var type breed;
sum number;
run;

What is the result?

A. The SUM statement produces only a grand total of NUMBER.
B. The SUM statement produces only subtotals of NUMBER for each value of TYPE.
C. The SUM statement produces both a grand total of NUMBER and subtotals of NUMBER for each value of TYPE.
D. Nothing is produced by the SUM statement; the program fails to execute.

답은 A입니다.

먼저, var 구문은 var 변수1 변수2... 처럼 뒤에 할당된 변수만 출력하겠다는 의미입니다.
다음으로 sum 구문은 뒤에 할당된 변수의 합을 계산해서 출력하겠다는 의미입니다.
앞의 var 구문과는 상관이 없습니다.

따라서, 결과는 type, breed, sum(number의 합)이 출력이되며, 이와 일치하는 설명은 A번입니다.

profile
IT를 시작하고자 합니다

0개의 댓글