<?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: Variable has been defined as both character and numeric in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Variable-has-been-defined-as-both-character-and-numeric/m-p/271719#M54053</link>
    <description>&lt;P&gt;&lt;SPAN&gt;data nicholas._21305_21501 ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;set nicholas._21305_21501 (rename=(i1_Value=i1_Value_Character i2_Value=i2_Value_Character)) ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;i1_Value = put(i1_Value_Character, 1.) ;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;i2_Value = put(i2_Value_Character, 1.) ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;drop i1_Value_Character i2_Value_Character&amp;nbsp;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;run ;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;and so on, for all wrong typed variables.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 19 May 2016 14:24:11 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2016-05-19T14:24:11Z</dc:date>
    <item>
      <title>Variable has been defined as both character and numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-has-been-defined-as-both-character-and-numeric/m-p/81482#M17523</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;I am trying to combine 8 datasets of different patient data captured in 6 month intervals in 2 different hospitals. So, I have to combine those 8 datasets so that I have one nice dataset that I could work on.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;When I try to combine using&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;SPAN style="color: #011993;"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt; Combined;&amp;nbsp; &lt;SPAN style="color: #0433ff;"&gt;set&lt;/SPAN&gt; fullextract1 fullextract2 fullextract3 fullextract4 fullextract5 fullextract6 fullextract7 fullextract8;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="font-size: 12pt;"&gt; &lt;STRONG&gt;run&lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 12pt;"&gt;I get multiple variables have been defined both as character and numeric like this: &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 8px; font-family: Courier;"&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 12pt;"&gt;ERROR: Variable DOB has been defined as both character and numeric.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 8px; font-family: Courier;"&gt;&lt;/P&gt;&lt;P style="font-size: 8px; font-family: Courier;"&gt;&lt;SPAN style="font-size: 12pt;"&gt;So, I tried to put this in data statement for all involved variables in the individual datasets (basically trying to convert to character variables): &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="font-size: 12pt;"&gt; DOBch= put (DOB, &lt;SPAN style="color: #009193;"&gt;$7.&lt;/SPAN&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;SPAN style="color: #0433ff;"&gt;drop&lt;/SPAN&gt; DOB; &lt;SPAN style="color: #0433ff;"&gt;rename&lt;/SPAN&gt; DOBch=DOB;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="font-size: 12pt;"&gt;But, still when finally try to combine using above combine statement, I still get these error statements. Please help. &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jan 2013 01:42:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-has-been-defined-as-both-character-and-numeric/m-p/81482#M17523</guid>
      <dc:creator>Venki</dc:creator>
      <dc:date>2013-01-22T01:42:42Z</dc:date>
    </item>
    <item>
      <title>Re: Variable has been defined as both character and numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-has-been-defined-as-both-character-and-numeric/m-p/81483#M17524</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try to do your conversions this way :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;data fullExtract1;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;set fullExtract1(rename=(DOB=DOBnum));&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;DOB = put(DOBnum, 7.);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;drop DOBnum;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jan 2013 02:14:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-has-been-defined-as-both-character-and-numeric/m-p/81483#M17524</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2013-01-22T02:14:59Z</dc:date>
    </item>
    <item>
      <title>Re: Variable has been defined as both character and numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-has-been-defined-as-both-character-and-numeric/m-p/81484#M17525</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot !!!!&lt;/P&gt;&lt;P&gt;It worked very well...Much appreciated..Venki&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jan 2013 04:34:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-has-been-defined-as-both-character-and-numeric/m-p/81484#M17525</guid>
      <dc:creator>Venki</dc:creator>
      <dc:date>2013-01-24T04:34:16Z</dc:date>
    </item>
    <item>
      <title>Re: Variable has been defined as both character and numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-has-been-defined-as-both-character-and-numeric/m-p/259903#M50356</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/462"&gt;@PGStats﻿&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just so I'm clear...The guidance is to convert the variables in each individual dataset before joining, correct?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Mar 2016 21:47:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-has-been-defined-as-both-character-and-numeric/m-p/259903#M50356</guid>
      <dc:creator>_maldini_</dc:creator>
      <dc:date>2016-03-29T21:47:35Z</dc:date>
    </item>
    <item>
      <title>Re: Variable has been defined as both character and numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-has-been-defined-as-both-character-and-numeric/m-p/259905#M50357</link>
      <description>&lt;P&gt;You can convert as you join. RENAME the wrongly typed variables in the SET statement, convert them in the code, assign the result to the properly named variables, and drop the renamed variable. You can do for multiple datasets the same as I proposed in this old post for a single dataset&lt;/P&gt;</description>
      <pubDate>Tue, 29 Mar 2016 22:08:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-has-been-defined-as-both-character-and-numeric/m-p/259905#M50357</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-03-29T22:08:39Z</dc:date>
    </item>
    <item>
      <title>Re: Variable has been defined as both character and numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-has-been-defined-as-both-character-and-numeric/m-p/271607#M54032</link>
      <description>&lt;P&gt;How would I combine two cases of your solution?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data nicholas._21305_21501 ;&lt;BR /&gt;set nicholas._21305_21501 (rename=(i1_Value=i1_Value_Character)) ;&lt;BR /&gt;i1_Value = put(i1_Value_Character, 1.) ;&lt;BR /&gt;drop i1_Value_Character ;&lt;BR /&gt;run ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data nicholas._21305_21501 ;&lt;BR /&gt;set nicholas._21305_21501 (rename=(i2_Value=i2_Value_Character)) ;&lt;BR /&gt;i2_Value = put(i2_Value_Character, 1.) ;&lt;BR /&gt;drop i2_Value_Character ;&lt;BR /&gt;run ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 May 2016 05:32:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-has-been-defined-as-both-character-and-numeric/m-p/271607#M54032</guid>
      <dc:creator>NKormanik</dc:creator>
      <dc:date>2016-05-19T05:32:47Z</dc:date>
    </item>
    <item>
      <title>Re: Variable has been defined as both character and numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-has-been-defined-as-both-character-and-numeric/m-p/271719#M54053</link>
      <description>&lt;P&gt;&lt;SPAN&gt;data nicholas._21305_21501 ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;set nicholas._21305_21501 (rename=(i1_Value=i1_Value_Character i2_Value=i2_Value_Character)) ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;i1_Value = put(i1_Value_Character, 1.) ;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;i2_Value = put(i2_Value_Character, 1.) ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;drop i1_Value_Character i2_Value_Character&amp;nbsp;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;run ;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;and so on, for all wrong typed variables.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 19 May 2016 14:24:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-has-been-defined-as-both-character-and-numeric/m-p/271719#M54053</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-05-19T14:24:11Z</dc:date>
    </item>
    <item>
      <title>Re: Variable has been defined as both character and numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-has-been-defined-as-both-character-and-numeric/m-p/406440#M98969</link>
      <description>&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;I had the same problem, but when I do this, in my final table there are no values for "p_no". There is a column, but the values are missing..&amp;nbsp;What can I do about it? Something with the ''7.''? What does that mean?&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA fullExtract1 (rename=(respno=p_nonum));
SET fullExtract1;
p_no = put(p_nonum, 7.);
DROP p_nonum;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2017 09:40:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-has-been-defined-as-both-character-and-numeric/m-p/406440#M98969</guid>
      <dc:creator>hovliza</dc:creator>
      <dc:date>2017-10-23T09:40:33Z</dc:date>
    </item>
    <item>
      <title>Re: Variable has been defined as both character and numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-has-been-defined-as-both-character-and-numeric/m-p/406662#M99048</link>
      <description>&lt;P&gt;Start a new forum topic, post the log and an example of the value of respno.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2017 17:43:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-has-been-defined-as-both-character-and-numeric/m-p/406662#M99048</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2017-10-23T17:43:38Z</dc:date>
    </item>
  </channel>
</rss>

