<?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: Error: Variable has been defined as both character and numeric in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Error-Variable-has-been-defined-as-both-character-and-numeric/m-p/266628#M52595</link>
    <description>Do you have columns in match or tomatch where a/b is a variable? Try to rename in=a and in=b then.</description>
    <pubDate>Wed, 27 Apr 2016 06:44:47 GMT</pubDate>
    <dc:creator>Filipvdr</dc:creator>
    <dc:date>2016-04-27T06:44:47Z</dc:date>
    <item>
      <title>Error: Variable has been defined as both character and numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-Variable-has-been-defined-as-both-character-and-numeric/m-p/266623#M52593</link>
      <description>&lt;P&gt;Hello guys,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know this problem has been answered a couple of times. But I tried most of the solution but I'm still unable to merge them and it's quite frustrating... so hope that you guys can help me see what's the problem here:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The data MATCH has account ID&amp;nbsp;(numerical) with other variables and TOMATCH has only account&amp;nbsp;ID&amp;nbsp;(numerical) and counts (numberical). Hence, I would like to merge the files so that my new data COMBINEFILES will have the account numbers and the counts.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data match;
set match(rename=(account=acc));
account=input(acc,f15.);
drop acc;
run;

data tomatch;
set tomatch (rename=(account=acc));
account=input(acc,f15.);
drop acc;
run;

data combinefiles;
merge match (in=a) tomatch (in=b);
by account;
if a;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;But the output is always:&lt;/P&gt;&lt;P&gt;ERROR: Variable b has been defined as both character and numeric.&lt;BR /&gt;ERROR: Variable a has been defined as both character and numeric.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Really appreciate if you guys can help me.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Apr 2016 06:23:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-Variable-has-been-defined-as-both-character-and-numeric/m-p/266623#M52593</guid>
      <dc:creator>LaiQ</dc:creator>
      <dc:date>2016-04-27T06:23:28Z</dc:date>
    </item>
    <item>
      <title>Re: Error: Variable has been defined as both character and numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-Variable-has-been-defined-as-both-character-and-numeric/m-p/266628#M52595</link>
      <description>Do you have columns in match or tomatch where a/b is a variable? Try to rename in=a and in=b then.</description>
      <pubDate>Wed, 27 Apr 2016 06:44:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-Variable-has-been-defined-as-both-character-and-numeric/m-p/266628#M52595</guid>
      <dc:creator>Filipvdr</dc:creator>
      <dc:date>2016-04-27T06:44:47Z</dc:date>
    </item>
    <item>
      <title>Re: Error: Variable has been defined as both character and numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-Variable-has-been-defined-as-both-character-and-numeric/m-p/266629#M52596</link>
      <description>&lt;P&gt;data match1;&lt;BR /&gt;input Account;&lt;BR /&gt;datalines;&lt;BR /&gt;1&lt;BR /&gt;2&lt;BR /&gt;3&lt;BR /&gt;5&lt;BR /&gt;;&lt;BR /&gt;data tomatch1;&lt;BR /&gt;input Account;&lt;BR /&gt;datalines;&lt;BR /&gt;1&lt;BR /&gt;2&lt;BR /&gt;3&lt;BR /&gt;6&lt;BR /&gt;;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;data match;&lt;BR /&gt;set match1(rename=(account=acc));&lt;BR /&gt;account= put(acc,15.);&lt;BR /&gt;drop acc;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;data tomatch;&lt;BR /&gt;set tomatch1 (rename=(account=acc));&lt;BR /&gt;account=put(acc,15.);&lt;BR /&gt;drop acc;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;data combinefiles;&lt;BR /&gt;merge match1 (in=a) tomatch1 (in=b);&lt;BR /&gt;by account;&lt;BR /&gt;if a;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Apr 2016 06:50:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-Variable-has-been-defined-as-both-character-and-numeric/m-p/266629#M52596</guid>
      <dc:creator>pearsoninst</dc:creator>
      <dc:date>2016-04-27T06:50:38Z</dc:date>
    </item>
    <item>
      <title>Re: Error: Variable has been defined as both character and numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-Variable-has-been-defined-as-both-character-and-numeric/m-p/266656#M52604</link>
      <description>&lt;P&gt;Your error doesn't match your data description.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please post code and log if you need further assistance.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/59783"&gt;@pearsoninst﻿&lt;/a&gt;&amp;nbsp;Is correct about checking your IN variables.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Apr 2016 09:05:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-Variable-has-been-defined-as-both-character-and-numeric/m-p/266656#M52604</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-04-27T09:05:02Z</dc:date>
    </item>
    <item>
      <title>Re: Error: Variable has been defined as both character and numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-Variable-has-been-defined-as-both-character-and-numeric/m-p/266660#M52605</link>
      <description>&lt;P&gt;Really sorry... I didn't check my variables properly as it's a huge dataset...&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a variable named a and b so that's why I am unable to merge.&lt;/P&gt;&lt;P&gt;But thank you once again! Will check more diligently next time!&lt;/P&gt;</description>
      <pubDate>Wed, 27 Apr 2016 09:14:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-Variable-has-been-defined-as-both-character-and-numeric/m-p/266660#M52605</guid>
      <dc:creator>LaiQ</dc:creator>
      <dc:date>2016-04-27T09:14:29Z</dc:date>
    </item>
    <item>
      <title>Re: Error: Variable has been defined as both character and numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-Variable-has-been-defined-as-both-character-and-numeric/m-p/266661#M52606</link>
      <description>Sorry, I have variables that are a and b. Hence I'm not able to merge. Will check properly next time.</description>
      <pubDate>Wed, 27 Apr 2016 09:15:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-Variable-has-been-defined-as-both-character-and-numeric/m-p/266661#M52606</guid>
      <dc:creator>LaiQ</dc:creator>
      <dc:date>2016-04-27T09:15:56Z</dc:date>
    </item>
    <item>
      <title>Re: Error: Variable has been defined as both character and numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-Variable-has-been-defined-as-both-character-and-numeric/m-p/266662#M52607</link>
      <description>Sorry, found my error. Will check next time before posting. Thank you for your help anyway!</description>
      <pubDate>Wed, 27 Apr 2016 09:16:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-Variable-has-been-defined-as-both-character-and-numeric/m-p/266662#M52607</guid>
      <dc:creator>LaiQ</dc:creator>
      <dc:date>2016-04-27T09:16:29Z</dc:date>
    </item>
  </channel>
</rss>

