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

SAS 베이스 자격증, SAS 문제풀이 



QUESTION NO: 144

A raw data record is listed below: 

--------10-------20-------30
1999/10/25

The following SAS program is submitted: 


data projectduration;

infile 'file-specification';
input date $ 1 - 10;
run;

Which one of the following statements completes the program above and computes the duration of the project in days as of today's date?


A. duration = today( ) - put(date,ddmmyy10.); 

B. duration = today( ) - put(date,yymmdd10.); 

C. duration = today( ) - input(date,ddmmyy10.); 

D. duration = today( ) - input(date,yymmdd10.);


지정된 날짜부터 현재까지의 기간을 기간 (duration)이라는 변수 안에 넣으려고 하는데요. 어떻게 하면 이 날짜기간이 계산될지 묻는 문제입니다. 


보기를 보면, put / input이 차이가 있네요. 


put : 수치값을 문자값으로 변환하는 역할을 하고, 

input : 문자값을 수치값으로 변환해주는 역할을 합니다. 

그러니 input중에 답을 고르면 되겠죠. 


input중에서 date 형식이 ddmmyy 냐, 아니면 yymmdd냐를 봤을때~ 

데이타가 1999 즉 year로 시작해서 yymmdd형식을 고르면 되겠습니다. 



Answer: D 


반응형

+ Recent posts