Merging on like
is not a great idea; it doesn't use indices and doesn't use a lot of the optimizations you otherwise get. However, sometimes it's necessary.
In SAS, though, I'd do this differently [and in most other SQLs...]
proc sql;
select a.*,b.*
from tera.SFTP as a,home.SFTP_1 as b
where find(a.zip_c,b.zip_extract)
;
quit;
That accomplishes the same thing as LIKE, but is more likely to allow SAS to use indices and optimizations, and is more clearly written.
To deal with possible column length issues, use TRIM:
data have_a;
length zip_c $50;
input @1 zip_c $50.;
datalines;
12345 99999
67890 99999
88001 99999
37013 99999
60037 99999
;;;;
run;
data have_b;
length zip_extract $7;
input zip_extract $;
datalines;
12345
37013
99998
;;;;
run;
proc sql;
title "No Rows!";
select a.*,b.*
from have_a as a,have_b as b
where find(a.zip_c,b.zip_extract)
;
quit;
proc sql;
title "Rows!";
select a.*,b.*
from have_a as a,have_b as b
where find(a.zip_c,trim(b.zip_extract))
;
quit;