<?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 already been defined as numeric. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Variable-has-already-been-defined-as-numeric/m-p/508681#M136652</link>
    <description>&lt;P&gt;The only guess I can give you:&lt;/P&gt;
&lt;P&gt;if&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;knkatd&lt;/LI-CODE&gt;
&lt;P&gt;is numeric, then &lt;/P&gt;
&lt;PRE&gt;knkath&lt;/PRE&gt;
&lt;P&gt;will also be numeric, and you can't use a character format for it.&lt;/P&gt;</description>
    <pubDate>Tue, 30 Oct 2018 13:22:22 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2018-10-30T13:22:22Z</dc:date>
    <item>
      <title>Variable has already been defined as numeric.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-has-already-been-defined-as-numeric/m-p/508665#M136644</link>
      <description>&lt;P&gt;I've created one variable in data step as follows. Meaning I creating the variable 'knkath' and it should equal to the other character variable 'knkatd'. In the same data step I'm using link statement and file statement to create the output file. When I execute the code, I got warning as shown below. Not sure how and where the variable 'knkath' has been defined as numeric. Is there any way to fix this warning?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;knkath = knkatd;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Log:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;219           @35  knkath   $2.
220        
221        	@37  knabew   3.
WARNING: Variable knkath has already been defined as numeric.&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Oct 2018 12:55:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-has-already-been-defined-as-numeric/m-p/508665#M136644</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2018-10-30T12:55:45Z</dc:date>
    </item>
    <item>
      <title>Re: Variable has already been defined as numeric.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-has-already-been-defined-as-numeric/m-p/508671#M136646</link>
      <description>&lt;P&gt;By now you should know that posting such small snippets is useless to detect the problem. You make yourself appear quite silly.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Oct 2018 13:03:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-has-already-been-defined-as-numeric/m-p/508671#M136646</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-10-30T13:03:34Z</dc:date>
    </item>
    <item>
      <title>Re: Variable has already been defined as numeric.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-has-already-been-defined-as-numeric/m-p/508677#M136650</link>
      <description>&lt;P&gt;It's a very big program to share with and that's why I gave only the snippet.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Oct 2018 13:12:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-has-already-been-defined-as-numeric/m-p/508677#M136650</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2018-10-30T13:12:05Z</dc:date>
    </item>
    <item>
      <title>Re: Variable has already been defined as numeric.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-has-already-been-defined-as-numeric/m-p/508681#M136652</link>
      <description>&lt;P&gt;The only guess I can give you:&lt;/P&gt;
&lt;P&gt;if&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;knkatd&lt;/LI-CODE&gt;
&lt;P&gt;is numeric, then &lt;/P&gt;
&lt;PRE&gt;knkath&lt;/PRE&gt;
&lt;P&gt;will also be numeric, and you can't use a character format for it.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Oct 2018 13:22:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-has-already-been-defined-as-numeric/m-p/508681#M136652</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-10-30T13:22:22Z</dc:date>
    </item>
    <item>
      <title>Re: Variable has already been defined as numeric.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-has-already-been-defined-as-numeric/m-p/508690#M136657</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/8409"&gt;@Babloo&lt;/a&gt;have you tried to put debuggers in your programs.&lt;/P&gt;&lt;P&gt;If you are using a datastep you can debug some issue like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data junkout / debug;&lt;/P&gt;&lt;P&gt;set junkin;&lt;/P&gt;&lt;P&gt;….. bunch of stuff you want to do.....&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;when you execute the process you can line step through the datastep.&lt;/P&gt;&lt;P&gt;try it you may find that you have the answer right in front of you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Oct 2018 13:54:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-has-already-been-defined-as-numeric/m-p/508690#M136657</guid>
      <dc:creator>VDD</dc:creator>
      <dc:date>2018-10-30T13:54:34Z</dc:date>
    </item>
    <item>
      <title>Re: Variable has already been defined as numeric.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-has-already-been-defined-as-numeric/m-p/508695#M136661</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/8409"&gt;@Babloo&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I've created one variable in data step as follows. Meaning I creating the variable 'knkath' and it should equal to the other character variable 'knkatd'. In the same data step I'm using link statement and file statement to create the output file. When I execute the code, I got warning as shown below. Not sure how and where the variable 'knkath' has been defined as numeric. Is there any way to fix this warning?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;knkath = knkatd;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Log:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;219           @35  knkath   $2.
220        
221        	@37  knabew   3.
WARNING: Variable knkath has already been defined as numeric.&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If you can't include the whole program that at least show the very first line that include the problem variable. That is likely what has set the variable type.&lt;/P&gt;
&lt;P&gt;OR if you have a SET, MERGE, UPDATE or MODIFY statement the characteristic of variable type could come from being in one of the data sets contributing.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Oct 2018 14:02:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-has-already-been-defined-as-numeric/m-p/508695#M136661</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-10-30T14:02:41Z</dc:date>
    </item>
    <item>
      <title>Re: Variable has already been defined as numeric.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-has-already-been-defined-as-numeric/m-p/508716#M136675</link>
      <description>I have already given the first line of the problem variable in the OP&lt;BR /&gt;</description>
      <pubDate>Tue, 30 Oct 2018 14:42:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-has-already-been-defined-as-numeric/m-p/508716#M136675</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2018-10-30T14:42:04Z</dc:date>
    </item>
    <item>
      <title>Re: Variable has already been defined as numeric.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-has-already-been-defined-as-numeric/m-p/508718#M136676</link>
      <description>Knkatd is not numeric though.&lt;BR /&gt;</description>
      <pubDate>Tue, 30 Oct 2018 14:43:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-has-already-been-defined-as-numeric/m-p/508718#M136676</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2018-10-30T14:43:04Z</dc:date>
    </item>
    <item>
      <title>Re: Variable has already been defined as numeric.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-has-already-been-defined-as-numeric/m-p/508724#M136679</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/8409"&gt;@Babloo&lt;/a&gt;&amp;nbsp; I recommended you to get hold of author Ron cody's book Learning SAS by example and get started seriously in of your posts. I was exactly or worse off 5-6 years ago when I was an absolute beginner in SAS. However some reading effort paid off.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I feel the pain that you are going through however I didn't resort to communities for extreme basics rather it was the book. I would like you to do the same and get up-to speed. If I can learn, anybody can!&lt;/P&gt;</description>
      <pubDate>Tue, 30 Oct 2018 14:53:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-has-already-been-defined-as-numeric/m-p/508724#M136679</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-10-30T14:53:08Z</dc:date>
    </item>
    <item>
      <title>Re: Variable has already been defined as numeric.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-has-already-been-defined-as-numeric/m-p/508740#M136685</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/8409"&gt;@Babloo&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;I have already given the first line of the problem variable in the OP&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;STRONG&gt;But&lt;/STRONG&gt; you have not indicated which is the first line. The assignment was copied from the editor so there is no line indicator as from the log.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this is the actual first use of he variable knkath then knkatd is character. If you have variables coming from a SET, MERGE, UPDATE or MODIFY statement and the variable KNKATH was in one of those data sets then that set it's type as numeric.&lt;/P&gt;
&lt;PRE&gt;knkath = knkatd;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Run Proc contents on all of the datasets contributing and verify that none of them have KNKATH as a variable. Show the results.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If knkath is numeric and kntatd is character then there would be a corresponding LOG entry similar to:&lt;/P&gt;
&lt;PRE&gt;NOTE: Character values have been converted to numeric values at the places given by:
      (Line):(Column).
      74:6
&lt;/PRE&gt;
&lt;P&gt;is there?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Oct 2018 15:07:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-has-already-been-defined-as-numeric/m-p/508740#M136685</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-10-30T15:07:36Z</dc:date>
    </item>
  </channel>
</rss>

