SAS Base, A00-211 Crambible 

SAS 베이스 자격증 


QUESTION NO: 48

The following SAS program is submitted: 


data work.flights;
destination = 'cph';
select(destination);

when('LHR') city = 'London'; 

when('CPH') city = 'Copenhagen'; 

otherwise city = 'Other';
end;

run;



What is the value of the CITY variable?


A. Other
B. Copenh
C. Copenhagen
D. ''(missing character value)


select & end구문에서 destination을 비교대상으로 선정했습니다. 이 변수가 LHR 이 포함되어있으면 city 변수를 만들어 London이라고 넣어주고요. 만약 CPH가 포함되어있으면 city 변수안에 Copenhagen으로 넣어주고 이 외의 상황일땐 Other로 넣어줍니다. 


지금 destination은 소문자 cph로 들어가있고요 select 구문에는 대문자 CPH로 들어가있어서 결국엔 Other로 할당되게 됩니다.  


Answer: A 


반응형

+ Recent posts