<?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: Change a Columns datatype to allow a Join in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Change-a-Columns-datatype-to-allow-a-Join/m-p/135552#M10975</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks ballardw/Patrick,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'll give these a try.&amp;nbsp; :smileycool:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 12 Nov 2013 20:36:08 GMT</pubDate>
    <dc:creator>pcfriendly</dc:creator>
    <dc:date>2013-11-12T20:36:08Z</dc:date>
    <item>
      <title>Change a Columns datatype to allow a Join</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Change-a-Columns-datatype-to-allow-a-Join/m-p/135548#M10971</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Forum,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using SAS Enterprise Guide 4.3 with Windows 7 in case it's useful.&lt;/P&gt;&lt;P&gt;I have 2 tables, with a Month_Id written as '201310' to denote October 2013 for example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Problem is, I have one table with this Column created as an Integer &amp;amp; another as a Varchar.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the best way to change one of them to the others datatype so I can join them?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Nov 2013 04:08:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Change-a-Columns-datatype-to-allow-a-Join/m-p/135548#M10971</guid>
      <dc:creator>pcfriendly</dc:creator>
      <dc:date>2013-11-08T04:08:07Z</dc:date>
    </item>
    <item>
      <title>Re: Change a Columns datatype to allow a Join</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Change-a-Columns-datatype-to-allow-a-Join/m-p/135549#M10972</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Join on put(integervaluedvariable, f6.) = characterversion&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Nov 2013 15:39:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Change-a-Columns-datatype-to-allow-a-Join/m-p/135549#M10972</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2013-11-08T15:39:56Z</dc:date>
    </item>
    <item>
      <title>Re: Change a Columns datatype to allow a Join</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Change-a-Columns-datatype-to-allow-a-Join/m-p/135550#M10973</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ballardw,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the response but I don't know what you mean?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you explain it in terms of using a Query builder with 2 tables, one table 'Table1' with the field 'Mon_Yr' as an Integer datatype &amp;amp; another table 'Table2' with the field 'Mon_Yr' as a Varchar datatype?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 10 Nov 2013 20:37:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Change-a-Columns-datatype-to-allow-a-Join/m-p/135550#M10973</guid>
      <dc:creator>pcfriendly</dc:creator>
      <dc:date>2013-11-10T20:37:34Z</dc:date>
    </item>
    <item>
      <title>Re: Change a Columns datatype to allow a Join</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Change-a-Columns-datatype-to-allow-a-Join/m-p/135551#M10974</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The EG Query Builder is a wizard which generates SQL code. As with all wizards there are always limitations.&lt;/P&gt;&lt;P&gt;What &lt;A __default_attr="260198" __jive_macro_name="user" class="jive_macro jive_macro_user" data-objecttype="3" href="https://communities.sas.com/"&gt;&lt;/A&gt; proposes would work but I haven't found a way using the wizard to generate such code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you need an inner join (so the result only containing matching rows) then you could "trick" the wizard by not defining a join at all but by defining a filter (this results in an implicit inner join).&lt;/P&gt;&lt;P&gt;I'm using an expression 'input(character_key, best16.)' which converts the digits in the character variable into a numeric value before comparing with the numeric key.&lt;/P&gt;&lt;P&gt; &lt;IMG alt="Capture.PNG" class="jive-image" src="https://communities.sas.com/legacyfs/online/4513_Capture.PNG" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you need another sort of join (eg. a left join) then I believe you need first a query builder node to create a calculated field which contains this numeric value (so you're using the input() there) and then you use the output table of this query in the next query builder where you join the 2 tables together.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 10 Nov 2013 23:41:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Change-a-Columns-datatype-to-allow-a-Join/m-p/135551#M10974</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2013-11-10T23:41:02Z</dc:date>
    </item>
    <item>
      <title>Re: Change a Columns datatype to allow a Join</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Change-a-Columns-datatype-to-allow-a-Join/m-p/135552#M10975</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks ballardw/Patrick,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'll give these a try.&amp;nbsp; :smileycool:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Nov 2013 20:36:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Change-a-Columns-datatype-to-allow-a-Join/m-p/135552#M10975</guid>
      <dc:creator>pcfriendly</dc:creator>
      <dc:date>2013-11-12T20:36:08Z</dc:date>
    </item>
  </channel>
</rss>

