BookmarkSubscribeRSS Feed
DSivic
Calcite | Level 5
Hi everyone, first visit to the forums!

I am doing a left join on two data sets and there are common data fields (other than the ones I'm joining on) in the two sets of data. Some of these common fields may not have the same data, though. I am wondering if when I left join data set B on data set A which of the common fields it will keep the data from, A or B?

proc sql;
create table edm_spg as
select a.*, b.*
from edm_spg a left join &tblout. b
on a.loan_number=b.loan_number and a.ldate=b.ldate;
quit;
run;


Thanks!
2 REPLIES 2
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
From the SAS support http://support.sas.com/ website:

Exploring PROC SQL® Joins and Join Algorithms
Kirk Paul Lafler, Software Intelligence Corporation, Spring Valley, California
http://support.sas.com/resources/papers/proceedings09/035-2009.pdf

TS-553, SQL Joins -- The Long and The Short of It
Paul Kent, SAS Institute Inc.
http://support.sas.com/techsup/technote/ts553.html


Scott Barry
SBBWorks, Inc.
DSivic
Calcite | Level 5
Thanks!

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

What is Bayesian Analysis?

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1043 views
  • 0 likes
  • 2 in conversation