Desktop productivity for business analysts and programmers

Outer Joins in Enterprise Guide

Posts: 0

Outer Joins in Enterprise Guide


I have a quick question about outer joins in EG. I know that in PROC SQL you can perform an outer join on only two tables at a time (this restriction was stated in the PROC SQL section of the Certification Guide for Advanced Programming). However, in EG I have joined three tables with outer joins without any error messages and the generated PROC SQL code looks fine.

Is the two table restriction for outer joins only a recommendation or has EG been modified to perform outer joins on multiple tables or am I courting disaster by even attempting this type of join?

I don't want to include any table joins that may produce inconsistent results and I am worried that by doing this type of join I may cause problems. Any advice on this situation would be greatly appreciated.

Respected Advisor
Posts: 4,138

Re: Outer Joins in Enterprise Guide

SAS EG is "only" a client. The code is always processed on the SAS Workspace Server. There can't be such a thing like a EG modification allowing to run SAS code which would run otherwise.

How does this EG generated SQL code look like? And does it make sense from a business point of view?

Cheers, Patrick
Super User
Posts: 5,391

Re: Outer Joins in Enterprise Guide

There are no real restriction to two tables in outer joins. Syntactically, you can only name two tables per LEFT|RIGHT JOIN clause. But SAS SQL allows you to nestle these, so that the result of the first join will be input to the next join, which you'll probably have in your SQL. So, EG will most probably produce accurate SQL for you when you use Filter and Query object.

Data never sleeps
Posts: 0

Re: Outer Joins in Enterprise Guide

Thanks for your help - I now understand better how these types of tables are combined in SAS. I have actually rewritten some of the queries to speed up the process time and your insight was helpful.
Ask a Question
Discussion stats
  • 3 replies
  • 3 in conversation