As the approach below results in a cartesian product using a hash table will be much better for performance (if the source tables are "big").
For small tables: I find the approach below easier to code.
data file1;
jobname='this is job abc001 and abc002'; output;
jobname='this is job abc003 '; output;
jobname='this is job abc004 '; output;
jobname='this is job abc005 '; output;
run;
data file2;
name='abc001';output;
name='abc002';output;
name='abc003';output;
name='abc004';output;
name='abc004';output;
name='job';output;
run;
proc sql;
select DISTINCT file1.*,ifc(file2.name ne '','1','0') as found
from file1 left join (select distinct name from file2) as file2
on find(file1.jobname,file2.name,'i');
quit;
HTH
Patrick
Added a DISTINCT to the outer select to avoid multiplying the result.
In case that there can be duplicate values for "jobname" in file1 which should be kept backmerging of file1 (left join with result set) would be necessary.
If your data is like in the example I'm right now not so sure how this could be solved with a hash table as there is no key. The only way a can think of right now would be to create an artificial and not unique key and then "hash" over this key with only one value using the hash iterator object - but this sounds to me close to a cartesian product.
Message was edited by: Patrick