proc sql;
creat table q6 as
select a.PRODUCT_ID,a.churn_month,b.*
from d.p3 as a left join lab as b
on a.PRODUCT_ID ne b.PRODUCT_ID;
QUIT;
lab table has 100000 records
log
How big are your tables? A Cartesian join will be big...
How big is your workspace, if you know?
Also, fix the first error (create misspelled) and repost you code/log.
How big are your tables? A Cartesian join will be big...
How big is your workspace, if you know?
Also, fix the first error (create misspelled) and repost you code/log.
If your intent is to find all records in table a that do not have an entry in b, then you wrote your query wrong.
As it is, it will output every combination of tables a and b where the product ID's dont match.
Think of 100 IDs in b and 10000 records in a. For every record in a, there will be 99 records in b that fulfill your condition, therefore you get 990000 records in the output. This is what happens with you and explodes your WORK.
I'd rather do this to find records in a that don't have a match in b:
proc sort data=d.p3;
by product_id;
run;
proc sort data=lab;
by product_id;
run;
data q6;
merge
d.p3 (in=a)
lab (in=b keep=product_id)
;
by product_id;
if a and not b;
run;
Unless you have a completely different intention, of course.
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.
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.