What is better way of doing this which takes less processing time? My actual data is huge and since below code produces cartesian product it is taking very large amount of time for processing.Below is sampel data
data one ;
datalines;
id name $;
100 sam
200 ram
;
run;
data two ;
datalines;
id name $;
100 sam
200 ram
300 paul
;
run;
Proc sql;
create table temp as
select b.id,b.name from
one a,
two b
where a.id NE b.id;
quit;
A very recent and long thread on Cartesian joins
Basically, if it has to be a Cartesian join, you can't optimize it and you can't speed it up. So the real question is ... can this be done without a Cartesian join? Please let us know.
Are both tables huge?
If not, the smaller table may fit into memory and then you could use the hash object in the datastep/proc ds2.
What operation are you trying to perform (in words).
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.