BookmarkSubscribeRSS Feed
Sathya3
Obsidian | Level 7

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;

 

3 REPLIES 3
PaigeMiller
Diamond | Level 26

A very recent and long thread on Cartesian joins

https://communities.sas.com/t5/SAS-Programming/NOTE-The-execution-of-this-query-involves-performing-...

 

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.

--
Paige Miller
LinusH
Tourmaline | Level 20

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.

 

Data never sleeps
PGStats
Opal | Level 21

What operation are you trying to perform (in words).

PG

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

How to Concatenate Values

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 154 views
  • 0 likes
  • 4 in conversation