SAS Base, A00-211 Crambible, SAS 크램바이블

SAS 베이스 자격증 



QUESTION NO: 140

A realtor has two customers. One customer wants to view a list of homes selling for less than $60,000. The other customer wants to view a list of homes selling for greater than $100,000. Assuming the PRICE variable is numeric, which one of the following PRINT procedure steps will select all desired observations?


A. proc print data =sasuser.houses; 

    where price lt 60000;
    where price gt 100000;
    run;


B. proc print data =sasuser.houses; 

    where price lt 60000 or price gt 100000; 

    run;


C. proc print data =sasuser.houses;
    where price lt 60000 and price gt 100000; 

    run;


D. proc print data =sasuser.houses;
    where price lt 60000 or where price gt 100000; 

    run;


리얼터가 한명의 고객에게는 $60,000 이하의 주택 가격 리스트를, 한명의 고객에겐 $100,000 이상의 주택 가격 리스트를 제공하려고 합니다. 이때 Price가 수치형 변수일때 어떤 방법으로 프린트를 하면 되는지에 관한 질문입니다. 


60,000 이하 또는 (or) 100,000 이상이니까 C는 해당되지 않겠지요. and 는 두 조건 둘 다 해당되는걸 말하는거라서 이때 값은 0으로 나옵니다. 


같은 변수 안에서, 즉 price라는 변수안에서 여러개의 값을 비교해서 프린트하고 싶으면 where price lt 60000 or price gt 100000 즉, where 조건문 뒤에 변수명을 적은 후, lt = less than 그 뒤에 값 or 변수명을 적은 후, gt = greater than 뒤에 값 이렇게 적으면 됩니다. 



Answer: B 


반응형

+ Recent posts