<?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 Re: SQL PROC SORT producing duplicates in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SQL-PROC-SORT-producing-duplicates/m-p/436951#M108747</link>
    <description>&lt;P&gt;Are you saying that you want:&lt;/P&gt;
&lt;PRE&gt;where mvab.dirtra = pave.direction and (pave.from_lhrs &amp;lt;= mvab.REFERENCE_NO &amp;lt;=  and pave.to_lhrs)
;&lt;/PRE&gt;
&lt;P&gt;of course, that is if mvab.REFERENCE_NO represents the lhrs to said existed in the mvab file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 14 Feb 2018 01:36:01 GMT</pubDate>
    <dc:creator>art297</dc:creator>
    <dc:date>2018-02-14T01:36:01Z</dc:date>
    <item>
      <title>SQL PROC SORT producing duplicates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQL-PROC-SORT-producing-duplicates/m-p/436941#M108741</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to bring together two tables using the following code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
      create table my.mvabpavement2008 as
      select *
      from  my.mvab2008p mvab, my.pavement2008 pave
where mvab.dirtra = pave.direction and mvab.REFERENCE_NO &amp;gt;= pave.from_lhrs and pave.to_lhrs &amp;gt;= mvab.REFERENCE_NO;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;However, when running that code I get duplicate results especially in cases where REFERENCE_NO= from_lhrs and REFERENCE_NO (not)equal to_lhrs and the vice versa. I would think that this paraphrasing would indicate that unless statements&amp;nbsp;are satisfied&amp;nbsp;it would&amp;nbsp;not produce an observation. What am I doing wrong?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A sample is attached.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2018 00:30:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQL-PROC-SORT-producing-duplicates/m-p/436941#M108741</guid>
      <dc:creator>iliyan</dc:creator>
      <dc:date>2018-02-14T00:30:37Z</dc:date>
    </item>
    <item>
      <title>Re: SQL PROC SORT producing duplicates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQL-PROC-SORT-producing-duplicates/m-p/436948#M108745</link>
      <description>&lt;P&gt;Why do you think they are duplicates? Your're merging two files and your conditions on those variables are &amp;gt;=, not equal to.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2018 01:02:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQL-PROC-SORT-producing-duplicates/m-p/436948#M108745</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2018-02-14T01:02:57Z</dc:date>
    </item>
    <item>
      <title>Re: SQL PROC SORT producing duplicates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQL-PROC-SORT-producing-duplicates/m-p/436950#M108746</link>
      <description>I want the lhrs in the mvab file to be bounded between the to and from lhrs&lt;BR /&gt;of the pavement file.&lt;BR /&gt;</description>
      <pubDate>Wed, 14 Feb 2018 01:25:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQL-PROC-SORT-producing-duplicates/m-p/436950#M108746</guid>
      <dc:creator>iliyan</dc:creator>
      <dc:date>2018-02-14T01:25:51Z</dc:date>
    </item>
    <item>
      <title>Re: SQL PROC SORT producing duplicates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQL-PROC-SORT-producing-duplicates/m-p/436951#M108747</link>
      <description>&lt;P&gt;Are you saying that you want:&lt;/P&gt;
&lt;PRE&gt;where mvab.dirtra = pave.direction and (pave.from_lhrs &amp;lt;= mvab.REFERENCE_NO &amp;lt;=  and pave.to_lhrs)
;&lt;/PRE&gt;
&lt;P&gt;of course, that is if mvab.REFERENCE_NO represents the lhrs to said existed in the mvab file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2018 01:36:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQL-PROC-SORT-producing-duplicates/m-p/436951#M108747</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2018-02-14T01:36:01Z</dc:date>
    </item>
    <item>
      <title>Re: SQL PROC SORT producing duplicates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQL-PROC-SORT-producing-duplicates/m-p/436975#M108751</link>
      <description>&lt;P&gt;EDIT, The solution is:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where mvab.dirtra = pave.direction and (pave.from_lhrs &amp;lt;= mvab.REFERENCE_NO &amp;lt; pave.to_lhrs);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;All that had to be done is to restrict the to_LHRS from matching.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2018 03:42:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQL-PROC-SORT-producing-duplicates/m-p/436975#M108751</guid>
      <dc:creator>iliyan</dc:creator>
      <dc:date>2018-02-14T03:42:11Z</dc:date>
    </item>
  </channel>
</rss>

