title: Left join of tables with specific instructions
body: <p>Would you kindly be able to assist me with writing SAS script for a specific type of left join as described below?</p>
  
  <p>I’m looking to do a left join of Table – A to Table B [given below], where full matching of all identifying fields or partial matching [at least 1 field] with the remaining fields in Table – B being missing/ null is also treated a missing; however, any partial/ full matching with at least one field populated in Table – B whilst being null/ missing in Table – A will be treated as non-match.</p>
  
  <p>Here’s an example of input tables [A and B] and output matching analysis/ results below:</p>
  
  <p>TABLE - A</p>
  
  <pre><code>S/N   COL_1   COL_2   COL_3   COL_4
  -----------------------------------
  1     A       p               ii
  2     A
  3     B       r
  </code></pre>
  
  <p>TABLE - B</p>
  
  <pre><code>S/N   COL_1   COL_2   COL_3   COL_4
  -----------------------------------
  1     A       p               ii
  2     A       q
  3     A
  4     A       p       7       ii
  5     B
  6     B       r               n
  </code></pre>
  
  <p>OUTPUT/ MATCHING ANALYSIS</p>
  
  <pre><code>TABLE - A   TABLE - B   MATCH   NO MATCH
  ----------------------------------------
  1           1           Y
  1           2                   N
  1           3           Y
  1           4                   N
  2           1                   N
  2           2                   N
  2           3           Y
  2           4                   N
  3           5           Y
  3           6                   N
  </code></pre>