<?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 DI Studio - UNION in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/DI-Studio-UNION/m-p/425178#M13075</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a couple of problems I need some help with:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've two tables with identical in columns that I want to UNION together - I'm using the SQL JOIN transformation, however I'm stumped on the&amp;nbsp;Mappings tab. &amp;nbsp;It appears you can only map &lt;U&gt;one&lt;/U&gt; of the sources to the target, thus ignoring that it is a UNION.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am also having issues with a CASE statement in the Target table - the CASE wizard allows you to select a column in the &lt;U&gt;target&lt;/U&gt; table, however this errors when running. &amp;nbsp;The error states&amp;nbsp;an ambiguity as the same column name is in the two &lt;U&gt;source&lt;/U&gt; tables even though I choose the target as the source.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using DI Studio 4.9&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TIA,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Gordon&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 05 Jan 2018 11:49:13 GMT</pubDate>
    <dc:creator>spuckle</dc:creator>
    <dc:date>2018-01-05T11:49:13Z</dc:date>
    <item>
      <title>DI Studio - UNION</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/DI-Studio-UNION/m-p/425178#M13075</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a couple of problems I need some help with:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've two tables with identical in columns that I want to UNION together - I'm using the SQL JOIN transformation, however I'm stumped on the&amp;nbsp;Mappings tab. &amp;nbsp;It appears you can only map &lt;U&gt;one&lt;/U&gt; of the sources to the target, thus ignoring that it is a UNION.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am also having issues with a CASE statement in the Target table - the CASE wizard allows you to select a column in the &lt;U&gt;target&lt;/U&gt; table, however this errors when running. &amp;nbsp;The error states&amp;nbsp;an ambiguity as the same column name is in the two &lt;U&gt;source&lt;/U&gt; tables even though I choose the target as the source.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using DI Studio 4.9&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TIA,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Gordon&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jan 2018 11:49:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/DI-Studio-UNION/m-p/425178#M13075</guid>
      <dc:creator>spuckle</dc:creator>
      <dc:date>2018-01-05T11:49:13Z</dc:date>
    </item>
    <item>
      <title>Re: DI Studio - UNION join</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/DI-Studio-UNION/m-p/425184#M13080</link>
      <description>&lt;P&gt;May I start by suggesting a look at SQL and what that means:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.w3schools.com/sql/" target="_blank"&gt;https://www.w3schools.com/sql/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;As your use of UNION and JOIN makes no sense.&amp;nbsp; They are two very different means of putting data together.&amp;nbsp; Union is the process of putting data underneath another dataset, a join means to merge the data together by means of identifying variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With this: "&lt;SPAN&gt;The error states&amp;nbsp;an ambiguity as the same column name is in the two&amp;nbsp;&lt;/SPAN&gt;&lt;U&gt;source&lt;/U&gt;&lt;SPAN&gt;&amp;nbsp;tables even though I choose the target as the source." - what this means is that the variable appears in both tables, and the compiler cannot decide which to take.&amp;nbsp; I don't know DI and its UI, but in SQL you would assign an alias to each table and then utilse the alias to indicate to the compiler which to take:&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;select case when A.ID=1 then 1 else 2 end as RESULT
from MYTABLE A&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;The A after the dataset here is the alias.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jan 2018 11:32:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/DI-Studio-UNION/m-p/425184#M13080</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-01-05T11:32:33Z</dc:date>
    </item>
    <item>
      <title>Re: DI Studio - UNION</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/DI-Studio-UNION/m-p/425196#M13085</link>
      <description>&lt;P&gt;I'm familiar with how to do it in SQL - in fact it's what I'm rebuilding in DI (for data lineage purposes).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;UNION is under the SQL "Join" transformations&amp;nbsp;in DI Studio&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DI Union.JPG" style="width: 800px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/17659i33A946447582D35E/image-dimensions/800x296?v=v2" width="800" height="296" role="button" title="DI Union.JPG" alt="DI Union.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The SELECT node above is where columns are mapped, obviously in a UNION we have both sources populating a single column in the target table, which DI appears not to allow.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jan 2018 11:58:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/DI-Studio-UNION/m-p/425196#M13085</guid>
      <dc:creator>spuckle</dc:creator>
      <dc:date>2018-01-05T11:58:47Z</dc:date>
    </item>
    <item>
      <title>Re: DI Studio - UNION</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/DI-Studio-UNION/m-p/425462#M13099</link>
      <description>&lt;P&gt;The SQL Union is available in the "Set Operators" transformation which is in the "SQL" group on the Transformations tab.&lt;/P&gt;</description>
      <pubDate>Sat, 06 Jan 2018 00:20:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/DI-Studio-UNION/m-p/425462#M13099</guid>
      <dc:creator>RLigtenberg</dc:creator>
      <dc:date>2018-01-06T00:20:40Z</dc:date>
    </item>
    <item>
      <title>Re: DI Studio - UNION</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/DI-Studio-UNION/m-p/425782#M13106</link>
      <description>&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;Here is some documentation.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;The union in the join transformation performs a Union Join: &lt;/FONT&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/sqlproc/63043/HTML/default/viewer.htm#p1bk7i6jqseje7n1lifcip8kzhpp.htm" target="_blank"&gt;&lt;FONT color="#0563c1" face="Calibri" size="3"&gt;http://support.sas.com/documentation/cdl/en/sqlproc/63043/HTML/default/viewer.htm#p1bk7i6jqseje7n1lifcip8kzhpp.htm&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;The union in the Set Operators transformation performs a “stacking” of tables and is probably what you are looking for: &lt;/FONT&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/sqlproc/63043/HTML/default/viewer.htm#n0vo2lglyrnexwn14emi8m0jqvrj.htm" target="_blank"&gt;&lt;FONT color="#0563c1" face="Calibri" size="3"&gt;http://support.sas.com/documentation/cdl/en/sqlproc/63043/HTML/default/viewer.htm#n0vo2lglyrnexwn14emi8m0jqvrj.htm&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jan 2018 15:24:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/DI-Studio-UNION/m-p/425782#M13106</guid>
      <dc:creator>RLigtenberg</dc:creator>
      <dc:date>2018-01-08T15:24:44Z</dc:date>
    </item>
  </channel>
</rss>

