proc sql;
create table want as select
data2.*
,case when data2.age between data1.age_1 and data1.age_2 then 1 else 0 end as flag
from data1 left join data2
on upcase(data1.name)=upcase(data2.name);
quit;
This code is untested, you need to provide data as working SAS data step code for it to be tested.
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 how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.