Based on the lowest and highest grade, the following creates a series of dummy variables indicating which grade level is served --- by schools.
input ID LOWEST_GRADE HIGHEST_GRADE;
1 4 9
2 9 12
array grades(*) grade1-grade12;
do i =1 to dim(grades);
if i ge lowest_grade and i le highest_grade then grades(i)=1;