d**m 发帖数: 42 | 1 一个quiz的题不会,想请教大家一下,先多谢大家了!
The dataset below contains enrollment records for students. Write code to
count the number of days each student was enrolled. Include both the start
date and the end date in the count. Beware of overlapping date ranges. As an
example student 1’s count should be 6.
data Enrollment;
informat Start_Date MMDDYY10. End_Date MMDDYY10.;
format Start_Date MMDDYY10. End_Date MMDDYY10.;
infile datalines dlm=',';
input Student_Id Start_Date End_Date;
datalines;
1,8/20/2012,8/23/2012
1,8/21/2012,8/25/2012
2,8/20/2012,8/22/2012
2,8/24/2012,8/25/2012
3,8/20/2012,8/23/2012
4,8/22/2012,8/23/2012
3,8/22/2012,8/23/2012
4,8/23/2012,8/24/2012
3,8/24/2012,8/24/2012
run; |