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