나루다루

SAS BASE Q15.if & output 본문

Study/SAS BASE

SAS BASE Q15.if & output

나루다루 2018. 2. 13. 01:45
728x90
반응형

QUESTION NO: 15

Given the SAS data set PRICES:

prodid price producttype NETWORK sales

B132S 2.34 HARDWARE 300 10

R18KY2 1.29 SOFTWARE 25 5

3KL8BY 6.37 HARDWARE 125 15

DY65DW 5.60 HARDWARE 45 5

DGTY23 4.55 HARDWARE 67 2

 

The following SAS program is submitted:

data hware inter soft;

set prices (keep = producttype price);

if price le 5.00;

if producttype = 'HARDWARE' then output HWARE;

else if producttype = 'NETWORK' then output INTER;

else if producttype = 'SOFTWARE' then output SOFT;

run;

 

How many observations does the HWARE data set contain?

 

A. 0

B. 2

C. 3

D. 4

 

 

Answer: B




# 문제 풀이

 - price<=5.0인 값 3개를 읽는다 -> 3개의 값 중 producttype = 'HARDWARE'인 값 2개를 hware에 넣는다.

728x90
반응형

'Study > SAS BASE' 카테고리의 다른 글

SAS BASE Q17. ods / Q66 참고.  (0) 2018.02.13
SAS BASE Q16.length  (0) 2018.02.13
SAS BASE Q14. 문자와 숫자의 비교  (0) 2018.02.13
SAS BASE Q13. read data & dlm [수정]  (0) 2018.02.13
SAS BASE Q12. do / Q21과 비교  (0) 2018.02.13
Comments