data lookup; length name $20; input name; cards; George Harry John Sam ; run; data have; input line1 $80.; cards; Some text that contains George Some text that contains Harry None of the names Two of the names George, and JOHN. Some text that contains nothing ; run; proc sql; create table have as select * from lookup,have order by name; quit; data want(keep=name CountG); set have; by name; if first.name then CountG=0; if index(upcase(line1),upcase(strip(name)))>0 then CountG+1; if last.name; run;
... View more