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.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Get started using SAS Studio to write, run and debug your SAS programs.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.