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.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.