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
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
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.
Ready to level-up your skills? Choose your own adventure.