BookmarkSubscribeRSS Feed
dxtran
Calcite | Level 5

Hello

I'm refreshing my knowledge on SAS EG.  I have table A that contains a list of all employees since the beginning of time and table B that has a list of all employees who terminated.  I want to keep only employees from A who are still with the company.  I can do this in Access with a left join A to B on EmpID where B.EmpID is null (Pictorially).  I don't know how to do this in EG once I do a left join.  How/where do I set the condition B.EmpID is null?

 

Thank you

2 REPLIES 2
JeffMaggio
Obsidian | Level 7

I would use a set operator for this:

proc sql; 

create table want as 
select * from a 
   except 
   select * from b; 

quit; 
dxtran
Calcite | Level 5

Thank you, this is great!  However, I was hoping for a solution in EG, not code, which I know would be difficult to illustrate here. 😞  but I think I'll "cheat" and build the code in EG.  🙂

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

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