<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic proc sql  multiplt left joins in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-multiplt-left-joins/m-p/487440#M127019</link>
    <description>&lt;P&gt;Hi all, I am trying to left join one table with two tables to get multiple variables. I wrote some code but its showing me an error. Any help is appreciated.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; proc sql;
 437         create table _02a_nl as
 438         select distinct a.*,b.labcomponent,b.TestResultCleaned,c.labcomponent,c.TestResultCleaned,neutrophil,lymphocyte
 439         ,b.TestDate as neu_date format mmddyy10. ,c.TestDate as lymp_date format mmddyy10.,
 440         case
 441         when b.labcomponent = 'Neutrophil Count (absolute)' and b.TestResultCleaned ne . then b.TestResultCleaned
 442         else .
 443         end as neutrophil,
 444         case
 445         when c.labcomponent = 'Lymphocyte Count Absolute' and c.TestResultCleaned ne . then c.TestResultCleaned
 446         else .
 447         end as lymphocyte
 448         from _02a_insurance as a
 449         left join dfi_panc.lab as b
 450         on a.PatientID = b.PatientID
 451         left join dfi_panc.lab as c
 452         on a.PatientID=c.PatientID
 453         and ((a.index_date -30) le b.TestDate le (a.index_date)) AND (b.labcomponent = ('Neutrophil Count (absolute)')
 454         AND ((a.index_date -30) le c.TestDate le (a.index_date)) AND (c.labcomponent =('Lymphocyte Count Absolute'))
 455        order by a.PatientID,b.TestDate,c.TestDate;
             _____
             79
 ERROR 79-322: Expecting a ).
 &lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 16 Aug 2018 14:31:53 GMT</pubDate>
    <dc:creator>manya92</dc:creator>
    <dc:date>2018-08-16T14:31:53Z</dc:date>
    <item>
      <title>proc sql  multiplt left joins</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-multiplt-left-joins/m-p/487440#M127019</link>
      <description>&lt;P&gt;Hi all, I am trying to left join one table with two tables to get multiple variables. I wrote some code but its showing me an error. Any help is appreciated.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; proc sql;
 437         create table _02a_nl as
 438         select distinct a.*,b.labcomponent,b.TestResultCleaned,c.labcomponent,c.TestResultCleaned,neutrophil,lymphocyte
 439         ,b.TestDate as neu_date format mmddyy10. ,c.TestDate as lymp_date format mmddyy10.,
 440         case
 441         when b.labcomponent = 'Neutrophil Count (absolute)' and b.TestResultCleaned ne . then b.TestResultCleaned
 442         else .
 443         end as neutrophil,
 444         case
 445         when c.labcomponent = 'Lymphocyte Count Absolute' and c.TestResultCleaned ne . then c.TestResultCleaned
 446         else .
 447         end as lymphocyte
 448         from _02a_insurance as a
 449         left join dfi_panc.lab as b
 450         on a.PatientID = b.PatientID
 451         left join dfi_panc.lab as c
 452         on a.PatientID=c.PatientID
 453         and ((a.index_date -30) le b.TestDate le (a.index_date)) AND (b.labcomponent = ('Neutrophil Count (absolute)')
 454         AND ((a.index_date -30) le c.TestDate le (a.index_date)) AND (c.labcomponent =('Lymphocyte Count Absolute'))
 455        order by a.PatientID,b.TestDate,c.TestDate;
             _____
             79
 ERROR 79-322: Expecting a ).
 &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 16 Aug 2018 14:31:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-multiplt-left-joins/m-p/487440#M127019</guid>
      <dc:creator>manya92</dc:creator>
      <dc:date>2018-08-16T14:31:53Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql  multiplt left joins</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-multiplt-left-joins/m-p/487446#M127022</link>
      <description>&lt;P&gt;Hi &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/208127"&gt;@manya92&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The error is from these two lines&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;and ........ AND (b.labcomponent = ('Neutrophil Count (absolute)')  /* This could be missing a closing )! */
AND ........ AND (c.labcomponent =('Lymphocyte Count Absolute')) /* This could be using the wrong syntax? */&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I think you need to revise either or both&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps,&lt;/P&gt;
&lt;P&gt;Ahmed&lt;/P&gt;</description>
      <pubDate>Thu, 16 Aug 2018 14:40:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-multiplt-left-joins/m-p/487446#M127022</guid>
      <dc:creator>AhmedAl_Attar</dc:creator>
      <dc:date>2018-08-16T14:40:24Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql  multiplt left joins</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-multiplt-left-joins/m-p/487457#M127026</link>
      <description>&lt;P&gt;In the Enhanced Editor, place the cursor after the last closing bracket. The Editor will highlight this bracket and the one opening bracket it sees as corresponding. This will give you a clue where a closing bracket is missing.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Aug 2018 14:49:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-multiplt-left-joins/m-p/487457#M127026</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-08-16T14:49:58Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql  multiplt left joins</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-multiplt-left-joins/m-p/557551#M155441</link>
      <description>Touche, the Flash!&lt;BR /&gt;</description>
      <pubDate>Thu, 09 May 2019 18:12:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-multiplt-left-joins/m-p/557551#M155441</guid>
      <dc:creator>ccaulkins9</dc:creator>
      <dc:date>2019-05-09T18:12:30Z</dc:date>
    </item>
  </channel>
</rss>

