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.  🙂

SAS Innovate 2025: Call for Content

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!

Submit your idea!

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
  • 381 views
  • 0 likes
  • 2 in conversation