The following SAS program is submitted:
libname temp 'SAS-data-library';
data work.new;
set temp.jobs;
format newdate mmddyy10.;
qdate = qtr(newdate);
ddate = weekday(newdate);
run;
proc print data = work.new;
run;
The variable NEWDATE contains the SAS date value for April 15, 2000.
What output is produced if April 15, 2000 falls on a Saturday?
A. Obs newdate qdate ddate
1 APR152000 2 6
B. Obs newdate qdate ddate
1 04/15/2000 2 6
C. Obs newdate qdate ddate
1 APR152000 2 7
D. Obs newdate qdate ddate
1 04/15/2000 2 7
Click Comment link to get answer
D
ReplyDeleteD
ReplyDeleteD
ReplyDeleteThe QTR function returns a value of 1, 2, 3, or 4 from a SAS date value to indicate the quarter of the year in which a date value falls.
Value Day of the Week
1 Sunday
2 Monday
3 Tuesday
4 Wednesday
5 Thursday
6 Friday
7 Saturday
weekday 是求礼拜几,礼拜日是1,礼拜六是7
ReplyDelete谢谢了
DeleteThis comment has been removed by the author.
DeleteD
ReplyDeleteDay of Weeks Starts from Sunday..
Week starts from Sunday and second quarter starts from April 1.
ReplyDeleteI ran prgm:
ReplyDeletedata work.new;
newdate='15APR2000'd;
format newdate mmddyy10.;
qdate = qtr(newdate);
ddate = weekday(newdate);
run; ans came D
D
ReplyDeleteIt is very use full blog and very important information about SAS.
ReplyDeleteOnline SAS Training
SAS training