I am trying to perform a full join (include all matches and non-matches based on two conditions keeping variables from both tables)
I am attempting to join by two conditions becuase "LCODE" in dataset A can be found as 'DCODE1" or "SCODE1" in two different variables in dataset B. I tried to increase buffersize as I read that could possibly resolve- it didnt.
I am getting this error from SAS when trying to perform this join. Can anyone help me? Thank you.
"The execution of this query involves performing one or more Cartesian product joins that can not be optimized."
PROC SQL buffersize=256000;
SELECT *
FROM EOY A FULL JOIN WC B ON
(A.LCODE = B.DCODE1) OR (A.LCODE = B.SCODE1);
QUIT;
That message isn't indicating an error .. just that proc sql couldn't optimize the request. Are you getting the desired results?
If not, some example data and desired results from that data would be helpful.
It fails to continue to execute. A pop-up window tells me " Output WINDOW FULL" and just stops.
Do you even want the results to appear on screen? Why not include a first line that creates a file? i.e,
create table replace_this_with_whatevertablenameyouwant as
Thank you Mr. Tabachneck! I created a table and that resolved the pop up box. Arghhh still trying to learn PROC SQL to join. Been using 'merge' statement and trying to learn joins. Thank you again!
PROC SQL buffersize=256000 noprint;
Thank you to Hai Kuo too! Really appreciate your help too!!
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.