BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
george7899
Fluorite | Level 6

Both the left and right tables have been standardized. There are 63 rows in the left table, and 31 rows in the right one.

A Data Join node (right join) was applied successfully. But the log shows there were 33 rows joined. Does it make sense to have 33 rows joined instead of 31?

1 ACCEPTED SOLUTION

Accepted Solutions
Astounding
PROC Star

Things to consider ... perhaps ...

 

  • The left table contains a few records that match the same record in the right table
  • The joining provisions are not specific enough, so that the same record in the left table matches multiple records in the right table.

It's almost certainly a result of what's in the data, combined with the joining criteria.

View solution in original post

4 REPLIES 4
Astounding
PROC Star

Things to consider ... perhaps ...

 

  • The left table contains a few records that match the same record in the right table
  • The joining provisions are not specific enough, so that the same record in the left table matches multiple records in the right table.

It's almost certainly a result of what's in the data, combined with the joining criteria.

george7899
Fluorite | Level 6
Yes, the left table does contain some records that match the same record in the right table.
novinosrin
Tourmaline | Level 20

A test to understand

 


data left;
do key_l=1 to 61;
 if key_l=31 then do _n_=1 to 3;
 output;
 end;
 else output;
end;
run;

data right;
 do key_r=1 to 31;
 output;
 end;
run;

proc sql;
create table w as
select *
from left  right join right 
on key_l=key_r;
quit;

sas-innovate-white.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.

 

Early bird rate extended! Save $200 when you sign up by March 31.

Register now!

How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 1241 views
  • 2 likes
  • 3 in conversation