BookmarkSubscribeRSS Feed

SAS Certified Advanced Programmer 덤프3 풀이 4-6

Started ‎08-10-2020 by
Modified ‎08-10-2020 by
Views 560

#4.Given the following SAS data set ONE:

 

ONE

REP COST
SMITH 200
SMITH 400
JONES 100
SMITH 600
JONES 100
JONES 200
JONES 400
SMITH 800
JONES 100
JONES 300

The following SAS program is submitted: 

 

proc sql;
select rep, avg(cost) as AVERAGE from one group by rep having avg(cost) > (select avg(cost) from one); quit;

Which one of the following reports is generated?

A.
REP AVERAGE
JONES 200

B.
REP AVERAGE
JONES 320

C.
REP AVERAGE
SMITH 320

D.
REP AVERAGE
SMITH 500

 

[정답] D

[풀이]

 

proc sql;
select rep, avg(cost) as AVERAGE from one /* rep변수와 cost변수의 평균 변수*/ 
group by rep /*특정값들을 그룹으로 묶고 그룹안에서 사칙연산 가능*/ having avg(cost) > (select avg(cost) from one);
/*having : group by 에서 조건을 주어 사용*/ quit;

avg(cost)는 320. rep 그룹별 320보다 크면 출력.

smith 그룹의 평균은 500.

jones 그룹의 평균은 200.

320보다 큰 smith 500이 출력됩니다.

 

#5. The following SAS program is submitted:
proc sort data = sales tagsort;
by month year;
run;

Which of the following resource(s) is the TAGSORT option reducing?
 
A.I/O usage only
B.CPU usage only
C.I/O and CPU usage
D.temporary disk usage
 
[정답]D
[풀이]
proc sort : sort 프로시저를 시행. 테이블 데이터를 순서대로 정렬.
tagsort: proc sort의 tagsort옵션은 많은 sas data set의 충분하지 않은 디스크를 가지고 있을 때 유용합니다.
by 구문과 비슷하게 변수들을 구분하고, 데이터들을 temporary file에 저장합니다.

 

 

6. The following SAS program is submitted: 

 

data one; 
do i = 1 to 10; 
ptobs = ceil(ranuni(0) * totobs); 
set temp point = ptobs nobs = totobs;
output; 
end; 
stop; 
run; 

 

The SAS data set TEMP contains 2,500,000 observations. 

Which one of the following represents the possible values for PTOBS?

 

A. any integer between 1 and 10
B. any real number between 0 and 1
C. any integer between 1 and 2,500,000
D. any real number between 1 and 2,500,000
 

[정답]C

[풀이]
*sas code
ceil : 소숫점 이하의 값을 올려 정수를 만드는 함수 (data가 3.58이면, 4가 된다)
ranuni: seed값을 입력받아 0~1의 난수를 발생시키는 함수
ptobs = ceil(ranuni(0) * totobs); 을 사용해서 난수 2,500,000개의 수가 정수로 출력됩니다.
Version history
Last update:
‎08-10-2020 08:30 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