SAS Base, A00-211 Crambible 

SAS 베이스 자격증 


QUESTION NO: 27


The following SAS program is submitted: 


libnametemp 'SAS data library';
data work.new;
set temp.jobs;

format newdate mmddyy10.; 

mdate= month(newdate); 

ddate= weekday(newdate); 

run;

proc print data = work.new; 

run;


The variable NEWDATE contains the SAS date value for April 15. 2005

What output is produced if April 15, 2005 falls on a Friday?


A. Obsnewdate mdate ddate 

    1 04/15/2005 APR 6
B. Obs newdate mdate ddate 

    1 04/15/2005 4 6

C. Obs newdate mdate ddate 

    1 04/15/2005 APR 7 

D. Obs newdate mdate ddate 

    1 04/15/2005 4 7



weekday(변수명) : 요일만 숫자로 변환. 단, 일요일은 1이 됨.  (Friday는 6)

month(변수명) : 달을 숫자로 변환. 1월이 1이 됨. 

mmddyy10. : 04/15/2005 형태



Answer: B 


반응형

SAS Base, A00-211 Crambible 

SAS 베이스 자격증 

QUESTION NO: 26

Given the SAS data set WORKAWARDS: 

WORK.AWARDS 

FNAME POINTS MONTH

Amy 2 4 

Amy 1 7 

Gerard 3 3 

Wang 3 3 

Wang 1 12 

Wang 1 8 


The following SAS program is submitted: 

proc sort data = work.awards; 

by descending fname points; 

run; 


How are the observations sorted?

A. ENAME POINTS MONTH 

    Wang 3 3 

    Wang 1 12 

    Wang 1 8 

    Gerard 3 3 

    Amy 2 4 

    Amy 1 7 

B. ENAME POINTS MONTH 

    Amy 2 4 

    Amy 1 7 

    Gerard 3 3 

    Wang 3 3 

    Wang 1 8 

    Wang 1 12 

C. ENAME POINTS MONTH 

    Wang 3 3 

    Wang 1 8 

    Wang 1 12 

    Gerard 3 3 

    Amy 2 4 

    Amy 1 7 

D. ENAME POINTS MONTH

    Wang 1 12 

    Wang 1 8 

    Wang 3 3 

    Gerard 3 3 

    Amy 1 7 

    Amy 2 4


by descending fname points; 라서 

fname에 대해 descending 즉, 내림차순으로 정렬한 뒤, 그 안에서의 points는 default 값인 ascending 즉, 오름차순으로 정렬하게 됩니다. 


Answer: D 


반응형

SAS Base, A00-211 Crambible 

SAS 베이스 자격증 


QUESTION NO: 25

Read the table:

 

Given the SAS data set SASUSER.HOUSES:


Obs style bedrooms baths price sqteet street 

1 CONDO 2 1.5 80050 1200 MAIN
2 CONDO 3 2.5 79350 1300 ELM
3 CONDO 4 2.5 127150 1400 OAK

4 CONDO 2 2.0 110700 1100 FIFTH
5 TWOSTORY 4 3.0 107250 2100 SECOND 

6 TWOSTORY 2 1.0 55650 1600 WEST
7 TWOSTORY 2 1.0 69250 1450 NORTH
6 TWOSTORY 4 2.5 102950 2000 SOUTH


The following SAS program is submitted:

proc report data = sasuser.houses nowd headline; 

column style price;
where price It 100000;
<insert DEFINE statement here>
define price / mean width = 9 format = dollar12.; 

title;
run;

The following output is desired:

style price
CONDO $79,700 

TWOSTORY $62550


Which DEFINE statement completes the program and produces the desired output?

A. define style / width = 9;
B. define style /orderwidth = 9;
C. define style / group width = 9; 

D. define style / display width = 9;



column 함수를 이용해서 style과 price 결과물을 보려고 하는데, 이때 price 가 100000 보다 lt - less than 즉 100000보다 작은 것만 보려고 합니다. 


원래 데이타는 콘도 / 투스토리 4개씩 있는 데이타가 결국엔 콘도 하나, 투스토리 하나 이렇게 나와있는거 보니까 그룹화가 되었겠죠. 


그래서 100000보다 작은것들의 mean (평균) 한 값이 나온 것입니다. 



Answer: C 


반응형

SAS Base, A00-211 Crambible 

SAS 베이스 자격증 


QUESTION NO: 24

Given the SAS data set ONE: 


ONE 

Obs Dte 

1 09JAN2005

2 12JAN2005


The following SAS program is submitted: 


data two;
set one;
day = <insert expression here>;

format dte date9.;
run;



The data set TWO is created:
TWO
Obs Dte Day
1 09JAN2005 1
12 JAN2005 4

Which expression successfully completed the program and created the variable DAY?


A. day(dte)
B. weekday(dte)

C. dayofweek(dte)
D. datdif(dte,'01jan2005'd,'act/act')



데이타 one을 불러워서 새로운 데이타 two 를 만들려고 하는데요. 

day 라는 함수를 어떻게 정의해야 위와같은 결과물이 나올까요..라는 질문입니다. 


format을 보니, Dte는 date9. 형태로 해서 Dte값 그대로 나왔고요. 


day를 보니까 1, 4 이네요. 

즉, 09JAN2005 는 1이고, 12JAN2005 는 4니까 아마 요일을 말하는거겠네요.

참고로 WEEKDAY(변수이름) - 일요일은 1이고, 수요일은 4 입니다.  



Answer: B 


반응형

SAS Base, A00-211 Crambible 

SAS 베이스 자격증 


QUESTION NO: 23


Given the SAS data set EMPLOYEES: EMPLOYEES


NAME SALARY 

Innis 60000
Jolli 50000
Ellis 55000

Liu 45000


The following SAS program is submitted:

proc print data = employees; 

where name like '_i%'; 

run;

What is contained in the output?


A. Liu only
B. Innis and Ellis only
C. Innis, Ellis, and Liu only 

D. Innis, Jolli, Ellis, and Liu




where name like '_i%';


i를 기준으로 

_  문자 & 숫자 가능,단, 갯수가 하나 

% 문자 & 숫자 가능, 갯수 제한 없음  


Innis  %i_
Jolli %i
Ellis %i_

Liu _i%



Answer: A 


반응형

+ Recent posts