/* Tracking observations with IN= option */ * This data set does not include all the observations of the previous student data set; /* Some students are missing from the test file or the HW file */ data tests; INPUT student $ period test1-test3; lines; Susan 2 81 93 100 Arnold 1 72 83 72 Barbara 1 91 72 84 Johnny 3 62 79 80 Sandra 3 98 74 90 ; run; data homework; INPUT student $ period hw1-hw4; lines; John 1 8 7 3 5 Billy 2 9 7 9 10 Susan 2 9 6 9 8 Arnold 1 7 9 6 10 Barbara 1 6 9 7 8 ; run; proc sort data=tests; by student; proc sort data=homework; by student; data allgrade; merge tests (IN = InTest) homework (IN = InHomework); by student; IF InTest = 1 THEN Test = 'Yes'; IF InTest = 0 THEN Test = 'No'; IF InHomework = 1 THEN HW = 'Yes'; IF InHomework = 0 THEN HW = 'No'; run; proc print data=allgrade; title 'Grades & data set each obs came from'; run;