<?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: DI Studio join differ from Oracle SQL on the same tables in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/DI-Studio-join-differ-from-Oracle-SQL-on-the-same-tables/m-p/467522#M14615</link>
    <description>&lt;P&gt;I suggest you try a SAS passthru query. That should definitely match Oracle.&lt;/P&gt;</description>
    <pubDate>Mon, 04 Jun 2018 21:11:52 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2018-06-04T21:11:52Z</dc:date>
    <item>
      <title>DI Studio join differ from Oracle SQL on the same tables</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/DI-Studio-join-differ-from-Oracle-SQL-on-the-same-tables/m-p/467243#M14603</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the query in Oracle SQL:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;select s.OWNER_CUSTOMER_KEY, s.SUBSCRIPTION_KEY, rap.COMM_SHAPE_ID, rap.RES_APP_INDICATOR_ID
from SUBSCRIPTION_DIM s 
left join MASTER_CUSTOMER mc on mc.KURT_ID = s.USER_CUSTOMER_KEY and s.DRM_MARKET_PRODUCT_GROUP = 'Mobil Tale'
left join RES_AND_APPROVAL rap on rap.MASTER_ID = mc.MASTER_ID and rap.comm_shape_id in (3,4) and rap.RES_APP_VALID_TO_DATE is null&lt;/PRE&gt;&lt;P&gt;This one reruns 4 160 298 rows.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SAS DI job with join transformation returns ridiculous 227 million rows.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
   create table work.W5JS0I6C as
   select
      SUBSCRIPTION_DIM.OWNER_CUSTOMER_KEY length = 8   
         label = 'OWNER_CUSTOMER_KEY',
      SUBSCRIPTION_DIM.SUBSCRIPTION_KEY length = 8   
         label = 'SUBSCRIPTION_KEY',
      RES_AND_APPROVAL.COMM_SHAPE_ID length = 8   
         label = 'COMM_SHAPE_ID',
      RES_AND_APPROVAL.RES_APP_INDICATOR_ID length = 8   
         label = 'RES_APP_INDICATOR_ID'
   from
      ciccm.SUBSCRIPTION_DIM as SUBSCRIPTION_DIM left join 
      CDC.MASTER_CUSTOMER as MASTER_CUSTOMER
         on
         (
            MASTER_CUSTOMER.KURT_ID  = SUBSCRIPTION_DIM.USER_CUSTOMER_KEY 
            and SUBSCRIPTION_DIM.DRM_MARKET_PRODUCT_GROUP = 'Mobil Tale'
         ) left join 
      CDC.RES_AND_APPROVAL as RES_AND_APPROVAL
         on
         (
            RES_AND_APPROVAL.MASTER_ID  = MASTER_CUSTOMER.MASTER_ID 
            and RES_AND_APPROVAL.COMM_SHAPE_ID  IN (3,4)
            and RES_AND_APPROVAL.RES_APP_VALID_TO_DATE  = .
         )
   ;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would say I am doing something very wrong here, I just don't see it.&lt;/P&gt;&lt;P&gt;I tried to variate DI job: extract subset from source tables first to make join "lighter", but regardless I get huge and wrong result data set.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Interesting is that when I run join on only first 2 tables, result is correct.&lt;/P&gt;&lt;P&gt;When I include 3rd one in this case, everything goes down the drain.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any hint is more than welcomed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;</description>
      <pubDate>Sun, 03 Jun 2018 19:35:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/DI-Studio-join-differ-from-Oracle-SQL-on-the-same-tables/m-p/467243#M14603</guid>
      <dc:creator>strsljen</dc:creator>
      <dc:date>2018-06-03T19:35:45Z</dc:date>
    </item>
    <item>
      <title>Re: DI Studio join differ from Oracle SQL on the same tables</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/DI-Studio-join-differ-from-Oracle-SQL-on-the-same-tables/m-p/467261#M14604</link>
      <description>If you only moved the query, add&lt;BR /&gt;Options sastrace = ',, d' sastraceloc = saslog nostsuffix;&lt;BR /&gt;You'll get the what the query transform to in Oracle.&lt;BR /&gt;Your Oracle query seems to accessing the same schema, but in SAS you have two libnames? Shouldn't change the logic though, just being curious...</description>
      <pubDate>Sun, 03 Jun 2018 21:22:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/DI-Studio-join-differ-from-Oracle-SQL-on-the-same-tables/m-p/467261#M14604</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2018-06-03T21:22:41Z</dc:date>
    </item>
    <item>
      <title>Re: DI Studio join differ from Oracle SQL on the same tables</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/DI-Studio-join-differ-from-Oracle-SQL-on-the-same-tables/m-p/467302#M14606</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the hint.&lt;/P&gt;&lt;P&gt;I removed scheme names from Oracle SQL for things to be clearer.&amp;nbsp;&lt;/P&gt;&lt;P&gt;In both cases, the same schemes are accessed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I checked the log with those options turned ON (attached). SAS accesses two Oracle schemas as two different users, if that makes any difference.&lt;/P&gt;&lt;P&gt;I didn't find anything that would point the cause of the problem in that log.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I did try to do an extract to work tables first (only subset of original oracle tables that will be used in a join later. The result was exactly the same .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jun 2018 05:55:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/DI-Studio-join-differ-from-Oracle-SQL-on-the-same-tables/m-p/467302#M14606</guid>
      <dc:creator>strsljen</dc:creator>
      <dc:date>2018-06-04T05:55:13Z</dc:date>
    </item>
    <item>
      <title>Re: DI Studio join differ from Oracle SQL on the same tables</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/DI-Studio-join-differ-from-Oracle-SQL-on-the-same-tables/m-p/467409#M14610</link>
      <description>Oh that's a mouthful...&lt;BR /&gt;Sorry my fingers stumbling on my phone, sastrace should read&lt;BR /&gt;',,,d'&lt;BR /&gt;Which hopefully give a nicer log...&lt;BR /&gt;</description>
      <pubDate>Mon, 04 Jun 2018 14:05:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/DI-Studio-join-differ-from-Oracle-SQL-on-the-same-tables/m-p/467409#M14610</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2018-06-04T14:05:54Z</dc:date>
    </item>
    <item>
      <title>Re: DI Studio join differ from Oracle SQL on the same tables</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/DI-Studio-join-differ-from-Oracle-SQL-on-the-same-tables/m-p/467522#M14615</link>
      <description>&lt;P&gt;I suggest you try a SAS passthru query. That should definitely match Oracle.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jun 2018 21:11:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/DI-Studio-join-differ-from-Oracle-SQL-on-the-same-tables/m-p/467522#M14615</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2018-06-04T21:11:52Z</dc:date>
    </item>
  </channel>
</rss>

