<?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: merging databases with multiple variables in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/merging-databases-with-multiple-variables/m-p/465819#M70586</link>
    <description>&lt;P&gt;I've checked the formatting in the databases and run the code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;sql&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;create&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;table&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; want &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;as&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;select&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; COALESCE(Sep2011.ContractNo,Oct2011.ContractNo,Nov2011.ContractNo) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;as&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; ContractNo, coalesce(Sep2011.BalanceOutstanding,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;as&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; value1, coalesce(Oct2011.BalanceOutstanding,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;as&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; value2, coalesce(Nov2011.BalanceOutstanding,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;as&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; value3&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;from&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; Sep2011 &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;full&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;join&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; Oct2011&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;on&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; Sep2011.ContractNo=Oct2011.ContractNo &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;full&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;join&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; Nov2011 &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;on&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; Oct2011.ContractNo=Nov2011.ContractNo;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;I get the Values merged for all three databases.&amp;nbsp; The only issue appears to be that several accounts that appear only in one database(Sep2011) show duplicate values in Value1.&amp;nbsp; Not sure why that would be.&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 29 May 2018 20:31:45 GMT</pubDate>
    <dc:creator>KevinL</dc:creator>
    <dc:date>2018-05-29T20:31:45Z</dc:date>
    <item>
      <title>merging databases with multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/merging-databases-with-multiple-variables/m-p/465782#M70573</link>
      <description>&lt;P&gt;Good day all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm still new at using SAS and have looked through some questions on this site and I'm still struggling.&amp;nbsp; I have two databases with numerous variables with the same name in each database:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DatabaseA&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ID&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Value&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Type&amp;nbsp;&amp;nbsp;&amp;nbsp; Category&lt;/P&gt;&lt;P&gt;124&amp;nbsp;&amp;nbsp; 45&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; A&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; New&lt;/P&gt;&lt;P&gt;125&amp;nbsp;&amp;nbsp; 100&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; B&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; New&lt;/P&gt;&lt;P&gt;126&amp;nbsp;&amp;nbsp; 48&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; A&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Old&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DatabaseB&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ID&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Value&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Type&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Category&lt;/P&gt;&lt;P&gt;124&amp;nbsp;&amp;nbsp; 69&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; A&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; New&lt;/P&gt;&lt;P&gt;125&amp;nbsp;&amp;nbsp; 101&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; B&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; New&lt;/P&gt;&lt;P&gt;127&amp;nbsp;&amp;nbsp;&amp;nbsp;87&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; B&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Old&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The result I'm looking for is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DatabaseC&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ID&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Value1&amp;nbsp;&amp;nbsp; Value2&lt;/P&gt;&lt;P&gt;124&amp;nbsp;&amp;nbsp; 45&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 69&lt;/P&gt;&lt;P&gt;125&amp;nbsp;&amp;nbsp; 100&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 101&lt;/P&gt;&lt;P&gt;126&amp;nbsp;&amp;nbsp; 48&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;127&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 87&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any assistance will be greatly appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 May 2018 18:16:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/merging-databases-with-multiple-variables/m-p/465782#M70573</guid>
      <dc:creator>KevinL</dc:creator>
      <dc:date>2018-05-29T18:16:23Z</dc:date>
    </item>
    <item>
      <title>Re: merging databases with multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/merging-databases-with-multiple-variables/m-p/465788#M70574</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data a;
input ID     Value     Type $   Category $;
cards;
124   45          A         New
125   100        B         New
126   48          A         Old
; 

data b;
input ID     Value     Type $    Category $;
cards;
124   69          A          New
125   101        B          New
127   87          B          Old
;

proc sql;
create table want as
select COALESCE(a.id,b.id) as id ,coalesce(a.value,0) as value1, coalesce(b.value,0) as value2
from a full join b
on a.id=b.id ;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 May 2018 18:27:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/merging-databases-with-multiple-variables/m-p/465788#M70574</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-05-29T18:27:55Z</dc:date>
    </item>
    <item>
      <title>Re: merging databases with multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/merging-databases-with-multiple-variables/m-p/465798#M70577</link>
      <description>&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;Thanks for the quick reply!&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;I've applied the code to two databases I've imported from Excel:&amp;nbsp; Sep2011 and Oct2011.&amp;nbsp; In each database the identifier is called "ContractNo" and the values are called "BalanceOutstanding".&amp;nbsp; So I amended the code as follows:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;sql&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;create&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;table&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; want &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;as&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;select&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; COALESCE(Sep2011.ContractNo,Oct2011.ContractNo) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;as&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; ContractNo ,coalesce(Sep2011.BalanceOutstanding,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;as&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; value1, coalesce(Oct2011.BalanceOutstanding,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;as&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; value2&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;from&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; Sep2011 &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;full&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;join&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; Oct2011&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;on&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; Sep2011.ContractNo=Oct2011.ContractNo;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;Unfortunately I'm getting this:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;259 proc sql;&lt;/P&gt;&lt;P&gt;260 create table Want2 as&lt;/P&gt;&lt;P&gt;261 select COALESCE(Sep2011.ContractNo,Oct2011.ContractNo) as ContractNo&lt;/P&gt;&lt;P&gt;261! ,coalesce(Sep2011.BalanceOutstanding,0) as value1, coalesce(Oct2011.BalanceOutstanding,0) as&lt;/P&gt;&lt;P&gt;261! value2&lt;/P&gt;&lt;P&gt;262 from Sep2011 full join Oct2011&lt;/P&gt;&lt;P&gt;263 on Sep2011.ContractNo=Oct2011.ContractNo;&lt;/P&gt;&lt;P&gt;ERROR: Expression using equals (=) has components that are of different data types.&lt;/P&gt;&lt;P&gt;ERROR: The COALESCE function requires its arguments to be of the same data type.&lt;/P&gt;&lt;P&gt;264 quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not sure if it's because some of the BalanceOutstanding in the databases are 0 or negative.&amp;nbsp; Or maybe I'm missing something obvious?&lt;/P&gt;</description>
      <pubDate>Tue, 29 May 2018 19:15:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/merging-databases-with-multiple-variables/m-p/465798#M70577</guid>
      <dc:creator>KevinL</dc:creator>
      <dc:date>2018-05-29T19:15:11Z</dc:date>
    </item>
    <item>
      <title>Re: merging databases with multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/merging-databases-with-multiple-variables/m-p/465800#M70578</link>
      <description>&lt;P&gt;is your&amp;nbsp;&lt;SPAN&gt;Sep2011.ContractNo,Oct2011.ContractNo&amp;nbsp; &amp;nbsp;character or numeric. If char then replace&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;COALESCE(Sep2011.ContractNo,Oct2011.ContractNo)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;with&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;COALESCEC&lt;/STRONG&gt;&lt;/EM&gt;(Sep2011.ContractNo,Oct2011.ContractNo)&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 May 2018 19:18:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/merging-databases-with-multiple-variables/m-p/465800#M70578</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-05-29T19:18:26Z</dc:date>
    </item>
    <item>
      <title>Re: merging databases with multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/merging-databases-with-multiple-variables/m-p/465803#M70579</link>
      <description>&lt;P&gt;Thank you very much!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I checked the input data and the identifiers were formatted as test in the one database and as numbers in the other.&amp;nbsp; After formatting the code worked!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Last thing, if I want to exclude one of the Types while merging, would I use the Keep or Drop function and if so, how would it be added to the code you provided?&lt;/P&gt;</description>
      <pubDate>Tue, 29 May 2018 19:44:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/merging-databases-with-multiple-variables/m-p/465803#M70579</guid>
      <dc:creator>KevinL</dc:creator>
      <dc:date>2018-05-29T19:44:38Z</dc:date>
    </item>
    <item>
      <title>Re: merging databases with multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/merging-databases-with-multiple-variables/m-p/465805#M70580</link>
      <description>&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;create&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;table&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;want(keep= your desired vars separated by space)&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;as&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 May 2018 19:46:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/merging-databases-with-multiple-variables/m-p/465805#M70580</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-05-29T19:46:02Z</dc:date>
    </item>
    <item>
      <title>Re: merging databases with multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/merging-databases-with-multiple-variables/m-p/465806#M70581</link>
      <description>&lt;P&gt;Last question then I'm done for the day, I promise!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I wanted to add a third database (Nov2011), how would the code change?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again, you've been most helpful!&lt;/P&gt;</description>
      <pubDate>Tue, 29 May 2018 19:55:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/merging-databases-with-multiple-variables/m-p/465806#M70581</guid>
      <dc:creator>KevinL</dc:creator>
      <dc:date>2018-05-29T19:55:34Z</dc:date>
    </item>
    <item>
      <title>Re: merging databases with multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/merging-databases-with-multiple-variables/m-p/465807#M70582</link>
      <description>&lt;P&gt;Any number of questions are welcome. That's what the forum is for.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ok, do you mean to join another table?&lt;/P&gt;&lt;P&gt;if so, you can extend the syntax like&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token procnames"&gt;proc&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;sql&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
create &lt;SPAN class="token statement"&gt;table&lt;/SPAN&gt; want as
&lt;SPAN class="token statement"&gt;select&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;COALESCE&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;a&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token keyword"&gt;id&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;b&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token keyword"&gt;id&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt; as &lt;SPAN class="token keyword"&gt;id&lt;/SPAN&gt; &lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;coalesce&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;a&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token keyword"&gt;value&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;0&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt; as value1&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;coalesce&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;b&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token keyword"&gt;value&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;0&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt; as value2
&lt;SPAN class="token keyword"&gt;from&lt;/SPAN&gt; a full join b
on a&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token keyword"&gt;id&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;b&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token keyword"&gt;id&lt;/SPAN&gt; &lt;BR /&gt;full join c &lt;BR /&gt;on b.id=c.id;
&lt;SPAN class="token procnames"&gt;quit&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp; Just look for full join syntax examples online&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 May 2018 20:00:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/merging-databases-with-multiple-variables/m-p/465807#M70582</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-05-29T20:00:17Z</dc:date>
    </item>
    <item>
      <title>Re: merging databases with multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/merging-databases-with-multiple-variables/m-p/465812#M70584</link>
      <description>&lt;P&gt;I want to merge three databases: Sep2011, Oct2011, Nov2011.&amp;nbsp; I would expect it to be something like this but it's not working.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;sql&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;create&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;table&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; want &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;as&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;select&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; COALESCE(Sep2011.ContractNo,Oct2011.ContractNo,Nov2011.ContractNo) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;as&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; ContractNo, coalesce(Sep2011.BalanceOutstanding,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;as&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; value1, coalesce(Oct2011.BalanceOutstanding,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;as&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; value2, coalesce(Nov2011.BalanceOutstanding,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;as&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; value3&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;from&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; Sep2011 &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;full&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;join&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; Oct2011&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;on&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; Sep2011.ContractNo=Oct2011.ContractNo &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;full&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;join&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; Nov2011 &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;on&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; Oct2011.ContractNo=Nov2011.ContractNo;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 May 2018 20:11:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/merging-databases-with-multiple-variables/m-p/465812#M70584</guid>
      <dc:creator>KevinL</dc:creator>
      <dc:date>2018-05-29T20:11:03Z</dc:date>
    </item>
    <item>
      <title>Re: merging databases with multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/merging-databases-with-multiple-variables/m-p/465815#M70585</link>
      <description>&lt;P&gt;Are you getting an error or incorrect results? any log message plz&lt;/P&gt;</description>
      <pubDate>Tue, 29 May 2018 20:15:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/merging-databases-with-multiple-variables/m-p/465815#M70585</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-05-29T20:15:54Z</dc:date>
    </item>
    <item>
      <title>Re: merging databases with multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/merging-databases-with-multiple-variables/m-p/465819#M70586</link>
      <description>&lt;P&gt;I've checked the formatting in the databases and run the code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;sql&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;create&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;table&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; want &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;as&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;select&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; COALESCE(Sep2011.ContractNo,Oct2011.ContractNo,Nov2011.ContractNo) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;as&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; ContractNo, coalesce(Sep2011.BalanceOutstanding,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;as&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; value1, coalesce(Oct2011.BalanceOutstanding,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;as&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; value2, coalesce(Nov2011.BalanceOutstanding,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;as&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; value3&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;from&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; Sep2011 &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;full&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;join&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; Oct2011&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;on&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; Sep2011.ContractNo=Oct2011.ContractNo &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;full&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;join&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; Nov2011 &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;on&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; Oct2011.ContractNo=Nov2011.ContractNo;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;I get the Values merged for all three databases.&amp;nbsp; The only issue appears to be that several accounts that appear only in one database(Sep2011) show duplicate values in Value1.&amp;nbsp; Not sure why that would be.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 May 2018 20:31:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/merging-databases-with-multiple-variables/m-p/465819#M70586</guid>
      <dc:creator>KevinL</dc:creator>
      <dc:date>2018-05-29T20:31:45Z</dc:date>
    </item>
    <item>
      <title>Re: merging databases with multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/merging-databases-with-multiple-variables/m-p/465822#M70587</link>
      <description>&lt;P&gt;Can you plz revise your input sample and post again? So I can work on that from my end plz&lt;/P&gt;</description>
      <pubDate>Tue, 29 May 2018 20:43:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/merging-databases-with-multiple-variables/m-p/465822#M70587</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-05-29T20:43:43Z</dc:date>
    </item>
    <item>
      <title>Re: merging databases with multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/merging-databases-with-multiple-variables/m-p/465823#M70588</link>
      <description>I’ll have a look at everything and see if I can find the problem and will&lt;BR /&gt;let you know tomorrow. It’s late here.&lt;BR /&gt;&lt;BR /&gt;Thanks again for everything!&lt;BR /&gt;</description>
      <pubDate>Tue, 29 May 2018 20:47:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/merging-databases-with-multiple-variables/m-p/465823#M70588</guid>
      <dc:creator>KevinL</dc:creator>
      <dc:date>2018-05-29T20:47:15Z</dc:date>
    </item>
    <item>
      <title>Re: merging databases with multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/merging-databases-with-multiple-variables/m-p/465829#M70589</link>
      <description>&lt;P&gt;Ok , You can always start a new thread to make a question precise and can expect precise answers which will make it comprehensive. Have a good rest of your day&lt;/P&gt;</description>
      <pubDate>Tue, 29 May 2018 20:54:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/merging-databases-with-multiple-variables/m-p/465829#M70589</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-05-29T20:54:39Z</dc:date>
    </item>
  </channel>
</rss>

