data temp; input id $ history $; datalines; T101 Y T101 Y T101 Y T102 Y T103 Y T103 Y ; run; proc sql; create table count as select id, count(id) as count, history from temp group by id ; quit; data temp2; set count (where=(history='Y' and count > 1)); run;
... View more