Try this for the desired output.
Thanks,
proc sql;
create table want as
select * from TABLE_A,TABLE_B
where Field_B contains strip(Field_A);
quit;
CODE NOT TESTED.
proc sql;
create table want as
select *
from A,B
where Field_B contains strip(Field_A ) ;
quit;
Xia Keshan
Thanks all.. it worked perfectly.
Can anyone help with what I'm doing wrong here (below), I'm basically trying to create 2 new fields if the match criteria happens with Mortgage_Number_3 and another with Mortgage_Number_5. Put a 1 if match and a 0 if not.. thanks
proc sql inobs=100;
create table ABC.TEST_ME_2011_3 as
select a._ID, b.Mortgage_Number_3
from ABC.New_claims_jun10 b, KY.Loan_default_prep30nov2011 a
where a.AR_ID contains strip(b.Mortgage_Number_3) then 1 else 0 as short
where a.AR_ID contains strip(b.Mortgage_Number_5) then 1 else 0 as long;
quit;
Use case statement in select portion of the query to create new variables based on some condition
case when a.AR_ID contains strip(b.Mortgage_Number_3) then 1 else 0 end as short
case when a.AR_ID contains strip(b.Mortgage_Number_5) then 1 else 0 end as long
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.