I was wondering... I can remember some SAS statements can't be used in a Proc SQL session. Like "left outer join". After creating this code, the "left" (see below in red) is not coloured blue like the remaining part of the formula "... outer join". I thought this was one of the statements that did not work (since left has another function in SAS). But the code does work. Can anyone confirm that a "left outer join" just works within a proc SQL step? Thanks in advance!
proc sql;
create table dir.deel2 as
select *
from dir.deel1 t1
left outer join nl_xxx.yyy t2 on
t1.accnr = t2.accbusid
;
quit;
I can confirm the use of left outer join. You can also test sql code by adding the noexec option to the proc sql statement.
Do I get you right: do you wonder if your program that does work, works?:smileyconfused:
SAS(R) 9.3 SQL Procedure User's Guide
Partly 😉
Since I've learned that you can't use certain SAS statements in a PROC SQL session (and I remember one of them was LEFT join, because LEFT is already reserved for the SAS base language), I was wondering if it will work correctly. It seems to work, but then again, why does "LEFT" not turn blue in the "left outer join" statement?
What will work and not work, is revealed by executing the program. The color scheming can't possibly reflect any aspect of SAS language. Just look how macros are color-coded...
But there must be some program rules i guess...? In the SAS course I followed, this was one of the topics (SAS statements used in Proc SQL). Otherwise SAS would be one big trial and error game?
SAS Documentation...?
Got them all (followed all base courses --> knowledge (as reffered to above) + sheets), books for certified base programmer (passed), now going for the advanced level (also all books in house). But round about 20k of pages... Thought it would be a good idea to post the question here, since this is a forum for / with SAS experts. Saves me some time.
I can confirm the use of left outer join. You can also test sql code by adding the noexec option to the proc sql statement.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.