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
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.