Help using Base SAS procedures

proc sql-- left join question

Accepted Solution Solved
Reply
Contributor
Posts: 22
Accepted Solution

proc sql-- left join question

select a.*, b.* from a left join b on a.key=b.key I want all a rows and matched b rows, but not including those b rows with empty key. Q1: if a.key=missing and b.key=missing then they will be matched. How to avoid that? Q2: if I add "where b.key is not missing", all rows with a.key=missing will be removed. So, WHERE is applied after Left Join? Any efficient way?


Accepted Solutions
Solution
‎11-26-2013 02:06 PM
Trusted Advisor
Posts: 1,631

Re: proc sql-- left join question

Q1

select a.*, b.* from a left join b(where=(not missing(key)))

View solution in original post


All Replies
Solution
‎11-26-2013 02:06 PM
Trusted Advisor
Posts: 1,631

Re: proc sql-- left join question

Q1

select a.*, b.* from a left join b(where=(not missing(key)))

Contributor
Posts: 22

Re: proc sql-- left join question

thanks.

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 206 views
  • 1 like
  • 2 in conversation