I want to select only those cases that are in grade 1 in year 0405, and those that are in grade 1 in year 0506, and those that are in grade 1 in year 0607. If I put a 'or' statement, it will give me out cases that are also in other grades, if I put an 'and' statement, no cases will be found. What is the code to select cases across multiple years, but all should be in grade 1 at that particular year. data total1; set total; if (a1_grade_04050=1) or (a1_grade_05060=1) or (a1_grade_06070=1) then output ; run; data total1; set total; if (a1_grade_04050=1) and (a1_grade_05060=1) and (a1_grade_06070=1) then output ; run;
... View more