Frankly, this problem is beyond my skill set, so I'm hoping for your help (and patience) as I struggle through this. My PROC SQL step that joins these 2 tables: proc sql; create table join1 as select a.*,t.absence_date, t.abs_count, t.abs_school, t.employee_name, t.employee_ssn from allsets as a left join tchabs2 as t on a.SSN=t.employee_SSN and a.schoolid=t.abs_school order by SSN; quit; My objective: compare a teacher's absences (Absence_Date in TCHABS2) to a given interval (dateenrolled, dateleft in ALLSETS) and if the absence occurs within the interval, then count the absence. Otherwise, ignore it. However, when I join the tables I quickly see how the number of obs proliferates. If a teacher has 7 absences and her class roster has 50 students, then one teacher generates 350 obs. Question: before I begin matching the two tables, should I consider using an array so that there is one record per teacher per school? I know enough about arrays to be dangerous. I'm picturing the TCHABS2 table being transformed into something like so: school_Id Employee_SSN Employee_Name Job_Description Absence_Date1 Absence_Type1 Absence_Date2 Absence_Type2 etc.. Absence_Date7 Absence_Type7 30 777 Joni Teacher Math 7-Oct-14 Full Day 8-Oct-14 Full Day 9-Apr-15 Half Day AM 26 777 Joni Teacher Math 7-Oct-14 Full Day 8-Oct-14 Full Day 9-Apr-15 Half Day AM TCHABS2 abs_school Employee_SSN Employee_Name Job_Description Absence_Date Absence_Type 30 777 Joni Teacher Math 7-Oct-14 Full Day 30 777 Joni Teacher Math 8-Oct-14 Full Day 30 777 Joni Teacher Math 30-Oct-14 Full Day 30 777 Joni Teacher Math 10-Feb-15 Full Day 30 777 Joni Teacher Math 11-Feb-15 Full Day 30 777 Joni Teacher Math 4-Mar-15 Full Day 30 777 Joni Teacher Math 9-Apr-15 Half Day AM 26 777 Joni Teacher Math 7-Oct-14 Full Day 26 777 Joni Teacher Math 8-Oct-14 Full Day 26 777 Joni Teacher Math 30-Oct-14 Full Day 26 777 Joni Teacher Math 10-Feb-15 Full Day 26 777 Joni Teacher Math 11-Feb-15 Full Day 26 777 Joni Teacher Math 4-Mar-15 Full Day 26 777 Joni Teacher Math 9-Apr-15 Half Day AM ALLSETS STUDENT Dateenrolled DateLeft Schoolid Course_Name ssn able 8/18/2014 10/14/2014 30 Mathematics 7 777 baker 8/18/2014 6/5/2015 30 Mathematics 7 777 charlie 8/18/2014 6/5/2015 30 Mathematics 7 777 delta 8/18/2014 6/5/2015 30 Mathematics 7 777 echo 8/18/2014 6/5/2015 30 Mathematics 7 777
... View more