<?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 merging issue in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/merging-issue/m-p/248566#M56446</link>
    <description>&lt;P&gt;Hi! I am a new-ish SAS user. I am trying to do a one-to-many data merge with two files in my work folder. However, I keep getting this error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ERROR: Variable Type has been defined as both character and numeric.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, the varaibles are exactly the same:&lt;/P&gt;&lt;P&gt;Name: NUMBER&lt;/P&gt;&lt;P&gt;Length: 8&lt;/P&gt;&lt;P&gt;Format: Best12&lt;/P&gt;&lt;P&gt;Informat: 12&lt;/P&gt;&lt;P&gt;Type: Numeric&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried multiplying NUMBER by one to be sure it is numeric or to see if it needed a reset of sorts, but that did not work&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;my sas code is this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/* Sorting data and merging */&lt;BR /&gt;proc sort data = A; by NUMBER;&lt;BR /&gt;run;&lt;BR /&gt;proc sort data = B; by NUMBER;&lt;BR /&gt;run;&lt;BR /&gt;/*One to many data merge - NUMBER is numeric */&lt;BR /&gt;data Merged_A_B;&lt;BR /&gt;merge A (in = aaa) B (in = bbb);&lt;BR /&gt;by NUMBER;&lt;BR /&gt;if aaa*bbb = 0 then delete;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am thinking it may be how I am merging and I have looked online for help but was not able to find it. Help with this would be much appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;C&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 07 Feb 2016 18:31:39 GMT</pubDate>
    <dc:creator>C0003</dc:creator>
    <dc:date>2016-02-07T18:31:39Z</dc:date>
    <item>
      <title>merging issue</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/merging-issue/m-p/248566#M56446</link>
      <description>&lt;P&gt;Hi! I am a new-ish SAS user. I am trying to do a one-to-many data merge with two files in my work folder. However, I keep getting this error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ERROR: Variable Type has been defined as both character and numeric.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, the varaibles are exactly the same:&lt;/P&gt;&lt;P&gt;Name: NUMBER&lt;/P&gt;&lt;P&gt;Length: 8&lt;/P&gt;&lt;P&gt;Format: Best12&lt;/P&gt;&lt;P&gt;Informat: 12&lt;/P&gt;&lt;P&gt;Type: Numeric&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried multiplying NUMBER by one to be sure it is numeric or to see if it needed a reset of sorts, but that did not work&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;my sas code is this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/* Sorting data and merging */&lt;BR /&gt;proc sort data = A; by NUMBER;&lt;BR /&gt;run;&lt;BR /&gt;proc sort data = B; by NUMBER;&lt;BR /&gt;run;&lt;BR /&gt;/*One to many data merge - NUMBER is numeric */&lt;BR /&gt;data Merged_A_B;&lt;BR /&gt;merge A (in = aaa) B (in = bbb);&lt;BR /&gt;by NUMBER;&lt;BR /&gt;if aaa*bbb = 0 then delete;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am thinking it may be how I am merging and I have looked online for help but was not able to find it. Help with this would be much appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;C&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 07 Feb 2016 18:31:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/merging-issue/m-p/248566#M56446</guid>
      <dc:creator>C0003</dc:creator>
      <dc:date>2016-02-07T18:31:39Z</dc:date>
    </item>
    <item>
      <title>Re: merging issue</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/merging-issue/m-p/248569#M56447</link>
      <description>&lt;P&gt;Post your log and a proc contents for both data sets.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you have any other variables that might have the same name in both data sets but different types?&lt;/P&gt;</description>
      <pubDate>Sun, 07 Feb 2016 19:15:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/merging-issue/m-p/248569#M56447</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-02-07T19:15:05Z</dc:date>
    </item>
    <item>
      <title>Re: merging issue</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/merging-issue/m-p/248574#M56448</link>
      <description>&lt;P&gt;This message is actually very specific. &amp;nbsp;There is no problem with the variable named NUMBER. &amp;nbsp;Rather, you have a variable named TYPE that is numeric in one of the data sets and character in the other.&lt;/P&gt;</description>
      <pubDate>Sun, 07 Feb 2016 20:29:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/merging-issue/m-p/248574#M56448</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-02-07T20:29:29Z</dc:date>
    </item>
    <item>
      <title>Re: merging issue</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/merging-issue/m-p/248576#M56449</link>
      <description>&lt;P&gt;You could replace the whole thing wth a single proc SQL step :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table Merged_A_B as
select A.number, A.type,
	/* other variables from A. or from B. */
from A inner join B on A.number=B.number;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 07 Feb 2016 21:30:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/merging-issue/m-p/248576#M56449</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-02-07T21:30:42Z</dc:date>
    </item>
    <item>
      <title>Re: merging issue</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/merging-issue/m-p/248840#M56479</link>
      <description>&lt;P&gt;Thank you! This was the issue. I was able to correct it and it runs perfectly. Thanks again!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;C&lt;/P&gt;</description>
      <pubDate>Tue, 09 Feb 2016 12:26:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/merging-issue/m-p/248840#M56479</guid>
      <dc:creator>C0003</dc:creator>
      <dc:date>2016-02-09T12:26:31Z</dc:date>
    </item>
  </channel>
</rss>

