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-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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