<?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 - DB2 WITH Statement in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/DI-DB2-WITH-Statement/m-p/85884#M846</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've never used DIS for DB2 queries but I have quite a bit of experience in using the DIS SQL join transformation. As there is no specific DB2 SQL join transformation and - in my opinion - the implementation of "normal" subqueries is already a pain, I strongly doubt that the SQL Join transformation supports specific DB2 WITH clauses.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So most likely you either need to define your query differently or you need user written code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On a side note:&lt;/P&gt;&lt;P&gt;Something I've realised only lately is that you can actually define a subquery as a SAS SQL view using a separate SQL Join node and then use this view as source for the next SQL Join (using SAS SQL and not pass-through SQL). As a SQL view is nothing else than "encapsulated SQL code" the access engine then takes the whole SQL in the second node and sends it to the DB for execution. I like to take this approach as it firstly allows me to unit test sub-queries separately and also because I don't have to use the sub-query stuff within the SQL Join transformation (I find it really hard to change a sub-query and it's also not very transparent what happens when looking at the job flow).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 23 Jul 2013 10:45:09 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2013-07-23T10:45:09Z</dc:date>
    <item>
      <title>DI - DB2 WITH Statement</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/DI-DB2-WITH-Statement/m-p/85883#M845</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone have any experience structuring a JOIN transformation (or other SQL transformation) for DB2 &lt;STRONG&gt;WITH&lt;/STRONG&gt; statement in DI?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Other than user written SQL I can't find a feasible replacement.&amp;nbsp; Please note that DB2 create query and global temporary tables are not allowed in our environment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions are greatly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jul 2013 14:36:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/DI-DB2-WITH-Statement/m-p/85883#M845</guid>
      <dc:creator>RobK777</dc:creator>
      <dc:date>2013-07-22T14:36:10Z</dc:date>
    </item>
    <item>
      <title>Re: DI - DB2 WITH Statement</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/DI-DB2-WITH-Statement/m-p/85884#M846</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've never used DIS for DB2 queries but I have quite a bit of experience in using the DIS SQL join transformation. As there is no specific DB2 SQL join transformation and - in my opinion - the implementation of "normal" subqueries is already a pain, I strongly doubt that the SQL Join transformation supports specific DB2 WITH clauses.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So most likely you either need to define your query differently or you need user written code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On a side note:&lt;/P&gt;&lt;P&gt;Something I've realised only lately is that you can actually define a subquery as a SAS SQL view using a separate SQL Join node and then use this view as source for the next SQL Join (using SAS SQL and not pass-through SQL). As a SQL view is nothing else than "encapsulated SQL code" the access engine then takes the whole SQL in the second node and sends it to the DB for execution. I like to take this approach as it firstly allows me to unit test sub-queries separately and also because I don't have to use the sub-query stuff within the SQL Join transformation (I find it really hard to change a sub-query and it's also not very transparent what happens when looking at the job flow).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jul 2013 10:45:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/DI-DB2-WITH-Statement/m-p/85884#M846</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2013-07-23T10:45:09Z</dc:date>
    </item>
    <item>
      <title>Re: DI - DB2 WITH Statement</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/DI-DB2-WITH-Statement/m-p/85885#M847</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Patrick,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your suggestion regarding two joins one not being a pass-trough appears to be working.&amp;nbsp; I turned on _tree option to examine execution SQL and it appears that SAS/ACCESS is translating SAS SQL to native SQL before executing the query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is an interesting approach, however it may limit some functionality relating to native DB2 sql, but non the less it is a viable option.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Jul 2013 19:08:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/DI-DB2-WITH-Statement/m-p/85885#M847</guid>
      <dc:creator>RobK777</dc:creator>
      <dc:date>2013-07-24T19:08:00Z</dc:date>
    </item>
  </channel>
</rss>

