SAS Base, A00-211 Crambible 

SAS 베이스 자격증 


QUESTION NO: 21


The following SAS program is submitted: data work.sales;
do year = 1 to 5;
do month = 1 to 12;

x+ 1;
end;
end;
run;



How many observations are written to the WORK.SALES data set?


A. 0 

B. 1 

C. 5 

D. 60



12번 문제 참고하세요. 링크링크>> http://statnmath.tistory.com/171  


여기서 따로 output으로 보내는 설정이 없어서 계속 반복문이 덮어쓰게 됩니다. 

따라서 최종적으로 PDV에서는 


year     month    X

5           12       60 

이렇게 되면서 observation은 결국 1개가 됩니다. 





덮어쓰는걸 원치 않을땐 아래처럼 output; 을 넣어줘야 합니다. - 이게 12번 문제예요.


do year = 1 to 5;
do month = 1 to 12;

x+ 1;

output; 
end;
end;


Answer: B 


반응형

+ Recent posts