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

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

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