Why are Res1 and Res2 always zero? I reduced my problem to the code below. I assume the issue is being caused by a mismatch of the data types, but I am not understanding how to address it. Any help is appreciated. /*SETUP*/ proc sql; create table MyListTable ( MyVal varchar(100) ); quit; proc sql; insert into MyListTable set MyVal='AR' set MyVal='ES'; quit; /*THE PROBLEM*/ proc sql; create table test as select b.memname, a.MyVal , index(a.MyVal, 'AR') as A_Found , index(b.memname, 'AR') as B_Found , index(upcase(b.memname), upcase(a.myval)) as Res1 , case when upcase(b.memname) like ('%' || a.MyVal || '%') then 1 else 0 end as Res2 from MyListTable a, DICTIONARY.TABLES b where b.libname='SASHELP' and b.memname like '%AR%'; quit;
... View more