BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi All...
I have 2 datasets with each 500 MB of size approx...when im left joining them the final dataset is coming around 7GB Can any one tell me the reason and how can i reduce that.Both of the input datasets are not sorted or donot have index. and i cant do a proc sort on them.and they contain duplicates values also...as they contain duplicate values i cant even create index on key column
Thanks & Regards
Sam
3 REPLIES 3
Doyleuk
Calcite | Level 5
Can you post your code so that we can view it
Peter_C
Rhodochrosite | Level 12
OK, having described the input side of your data model, it is understandable that proc sql might have some trouble. You can help proc sql to control that explosion of data with a variety of conditions in the join and in where clause(s). If these are unneccessary, you may have to accept that the output side of your problem will be a 7GB file.
When you offer code, it might become possible to help you more.

PeterC
Doc_Duke
Rhodochrosite | Level 12
Sam,

The problem is the rows with duplicates on the join fields. If you have, say, 4 rows in the left table that match 5 rows in the right table, you will have 20 rows in the result table.

It's still a left join (all the rows in the left table are kept), but it generates a mini-Cartesian product for the matches.

Doc Muhlbaier
Duke

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

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

View all other training opportunities.

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