<?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 Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Error-Variable-has-been-defined-as-both-character-and-numeric/m-p/127247#M10497</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would confirm that variablex is now a character variable. I suspect not. If not, try using variablex = put(a_variablex,f5.);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 16 Jan 2013 16:51:38 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2013-01-16T16:51:38Z</dc:date>
    <item>
      <title>Error:  Variable has been defined as both character and numeric</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Error-Variable-has-been-defined-as-both-character-and-numeric/m-p/127244#M10494</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is my code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data libname.file_combined;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set libname.file_a&lt;/P&gt;&lt;P&gt;libname.file_b;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to merge two files and got this error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ERROR:&amp;nbsp; Variable X has been defined as both character and numeric.&lt;/P&gt;&lt;P&gt;ERROR:&amp;nbsp; Variable Y has been defined as both character and numeric.&lt;/P&gt;&lt;P&gt;ERROR:&amp;nbsp; Variable Z has been defined as both character and numeric.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Variables X, Y and Z has cells that are either numeric or alpha-numeric.&amp;nbsp; So my assumption is that I have to convert them to character.&amp;nbsp; I ran this code I got an error:&amp;nbsp; EXPECTING a FORMAT NAME.&amp;nbsp; It looks like SAS doesn't like the 5.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data file_a (drop=a_variablex);&lt;/P&gt;&lt;P&gt;set file_a (rename=(variablex=a_variablex));&lt;/P&gt;&lt;P&gt;variablex=input(a_variablex,5);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any advice/help is appreciated!&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jan 2013 15:09:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Error-Variable-has-been-defined-as-both-character-and-numeric/m-p/127244#M10494</guid>
      <dc:creator>jen123</dc:creator>
      <dc:date>2013-01-16T15:09:48Z</dc:date>
    </item>
    <item>
      <title>Re: Error:  Variable has been defined as both character and numeric</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Error-Variable-has-been-defined-as-both-character-and-numeric/m-p/127245#M10495</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When using a Format you need to have a period at the end.&lt;/P&gt;&lt;P&gt;Try&lt;/P&gt;&lt;P&gt;variablex= input(a_variablex,f5.);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may have done this already, but it may be a good idea to run Proc Compare to see which data set has the numeric and which has the character versions of the variables in question.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jan 2013 15:22:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Error-Variable-has-been-defined-as-both-character-and-numeric/m-p/127245#M10495</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2013-01-16T15:22: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-Enterprise-Guide/Error-Variable-has-been-defined-as-both-character-and-numeric/m-p/127246#M10496</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I did a PROC COMPARE:&amp;nbsp; file_a = $5. (character) and file_b=BEST 12. (num)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I ran this code and still got the same error (Variable has been definted as both character and numeric).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data file_b (drop=a_variablex);&lt;/P&gt;&lt;P&gt;set file_b (rename=(variablex=a_variablex));&lt;/P&gt;&lt;P&gt;variablex=input(a_variablex,$5.);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thoughts???&lt;/P&gt;&lt;P&gt;&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>Wed, 16 Jan 2013 15:51:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Error-Variable-has-been-defined-as-both-character-and-numeric/m-p/127246#M10496</guid>
      <dc:creator>jen123</dc:creator>
      <dc:date>2013-01-16T15:51:55Z</dc:date>
    </item>
    <item>
      <title>Re: Error:  Variable has been defined as both character and numeric</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Error-Variable-has-been-defined-as-both-character-and-numeric/m-p/127247#M10497</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would confirm that variablex is now a character variable. I suspect not. If not, try using variablex = put(a_variablex,f5.);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jan 2013 16:51:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Error-Variable-has-been-defined-as-both-character-and-numeric/m-p/127247#M10497</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2013-01-16T16:51:38Z</dc:date>
    </item>
  </channel>
</rss>

