나루다루

SAS BASE Q27. month , weekday 본문

Study/SAS BASE

SAS BASE Q27. month , weekday

나루다루 2018. 10. 30. 01:44
728x90
반응형

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. Obs newdate 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

 

 

Answer: B




# 구문 설명

 - ~ fall on + 날짜 : ~는 날짜이다


# 문제 풀이

 - month() : 날짜의 월(숫자)을 표기


 - weekday() : 날짜의 요일(숫자)을 표기. 1=일요일 ~ 7=토요일

728x90
반응형

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

SAS BASE Q29. varnum  (0) 2018.10.30
SAS BASE Q28. @  (0) 2018.10.30
SAS BASE Q26. proc sort [수정]  (0) 2018.10.30
[SAS BASE] informat 정리  (0) 2018.05.30
[SAS BASE] Q58. first & last & if  (0) 2018.05.28
Comments