Help using Base SAS procedures

Left Join in SQL

Reply
New Contributor
Posts: 2

Left Join in SQL

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!
Super Contributor
Super Contributor
Posts: 3,174

Re: Left Join in SQL

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.
New Contributor
Posts: 2

Re: Left Join in SQL

Thanks!
Ask a Question
Discussion stats
  • 2 replies
  • 124 views
  • 0 likes
  • 2 in conversation