I have 2 datasets;
dataset a
Name Age
John 70
Apple 67
June 67
Ewan 43
dataset b
Location
London
What is the fastest way to get this result? Anyone can help? Thanks.
Name Age Location
John 70 London
Apple 67 London
June 67 London
Ewan 43 London
Fastest to program? Fastest to execute? Fastest to explain how it works?
Here's one way:
data want;
if _n_=1 then set b;
set a;
run;
The full Cartesian product (already suggested) is a short program as well:
proc sql;
create table want as select * from a, b;
quit;
You can test them on larger data sets and let us know which one is faster.
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!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.