请教下sas大神,本人才学sas。遇到了一个题目希望大神帮忙post程序上来,小弟不甚感激!!!谢谢!!!
题目如下:
The dataset below contains enrollment records for students.Write code to count the number of days each student was enrolled. Include boththe start date and the end date in the count. Beware of overlapping dateranges. As an example student 1’s count should be.
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;