<?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 Help: Character values have been converted to numeric values at the places given by: in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Help-Character-values-have-been-converted-to-numeric-values-at/m-p/462656#M117813</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am getting this note and I dont know what to do. This is my code. Does anybody know?&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data drug_groups;&lt;BR /&gt;set datensatz_drugs;&lt;BR /&gt;if NIS_Nummer="6513" then allergy=1;&lt;BR /&gt;if NIS_Nummer="6699" then allergy=1; /*N=2*/&lt;BR /&gt;&lt;BR /&gt;if NIS_Nummer="2047" then antibiotics=1;&lt;BR /&gt;if NIS_Nummer="6613" then antibiotics=1;&lt;BR /&gt;if NIS_Nummer="6623" then antibiotics=1;&lt;BR /&gt;if NIS_Nummer="6725" then antibiotics=1;&lt;BR /&gt;if NIS_Nummer="7030" then antibiotics=1; /*N=5*/&lt;BR /&gt;&lt;BR /&gt;if NIS_Nummer="6622" then antidiabetic=1;&lt;BR /&gt;if NIS_Nummer="6629" then antidiabetic=1;&lt;BR /&gt;if NIS_Nummer="6649" then antidiabetic=1;&lt;BR /&gt;if NIS_Nummer="6818" then antidiabetic=1;&lt;BR /&gt;if NIS_Nummer="6819" then antidiabetic=1;&amp;nbsp; /*N=5*/&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 16 May 2018 12:56:45 GMT</pubDate>
    <dc:creator>marysmith</dc:creator>
    <dc:date>2018-05-16T12:56:45Z</dc:date>
    <item>
      <title>Help: Character values have been converted to numeric values at the places given by:</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-Character-values-have-been-converted-to-numeric-values-at/m-p/462656#M117813</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am getting this note and I dont know what to do. This is my code. Does anybody know?&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data drug_groups;&lt;BR /&gt;set datensatz_drugs;&lt;BR /&gt;if NIS_Nummer="6513" then allergy=1;&lt;BR /&gt;if NIS_Nummer="6699" then allergy=1; /*N=2*/&lt;BR /&gt;&lt;BR /&gt;if NIS_Nummer="2047" then antibiotics=1;&lt;BR /&gt;if NIS_Nummer="6613" then antibiotics=1;&lt;BR /&gt;if NIS_Nummer="6623" then antibiotics=1;&lt;BR /&gt;if NIS_Nummer="6725" then antibiotics=1;&lt;BR /&gt;if NIS_Nummer="7030" then antibiotics=1; /*N=5*/&lt;BR /&gt;&lt;BR /&gt;if NIS_Nummer="6622" then antidiabetic=1;&lt;BR /&gt;if NIS_Nummer="6629" then antidiabetic=1;&lt;BR /&gt;if NIS_Nummer="6649" then antidiabetic=1;&lt;BR /&gt;if NIS_Nummer="6818" then antidiabetic=1;&lt;BR /&gt;if NIS_Nummer="6819" then antidiabetic=1;&amp;nbsp; /*N=5*/&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 May 2018 12:56:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-Character-values-have-been-converted-to-numeric-values-at/m-p/462656#M117813</guid>
      <dc:creator>marysmith</dc:creator>
      <dc:date>2018-05-16T12:56:45Z</dc:date>
    </item>
    <item>
      <title>Re: Help: Character values have been converted to numeric values at the places given by:</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-Character-values-have-been-converted-to-numeric-values-at/m-p/462663#M117815</link>
      <description>&lt;P&gt;In future, please show some test data in the form of a datastep, otherwise we are just guessing.&lt;/P&gt;
&lt;P&gt;Is NIS_Number a number or character?&amp;nbsp; Has Alergy, antibiotics, or antidiabetic been defined as character or numeric?&lt;/P&gt;
&lt;P&gt;Also, you can shrink your code drastically by:&lt;/P&gt;
&lt;PRE&gt;data drug_groups;
  set datensatz_drugs;
  if nis_nummer in ("6513","6699") then allergy=1;
  if nis_nummer in ("2047"...) then antibiotics=1;
...
run;

Or even:
...
  select(nis_nummer);
    when("6513","6699") allergy=1;
    when("2047"...) antibiotics=1;
...
  end;&lt;/PRE&gt;</description>
      <pubDate>Wed, 16 May 2018 13:05:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-Character-values-have-been-converted-to-numeric-values-at/m-p/462663#M117815</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-05-16T13:05:49Z</dc:date>
    </item>
    <item>
      <title>Re: Help: Character values have been converted to numeric values at the places given by:</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-Character-values-have-been-converted-to-numeric-values-at/m-p/462664#M117816</link>
      <description>&lt;P&gt;If NIS_Nummer is numeric, omit the quotes:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if NIS_Nummer = 6513 then allergy = 1;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Otherwise, if the variables used in the "then" branch exist already and are of type character, use quotes there.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Strong hint: always post the log! It contains valuable information exactly where the problem lies.&lt;/P&gt;
&lt;P&gt;Use the {i} button and see my footnotes for hints on posting code, logs and other text that must not be changed by the forum webapp.&lt;/P&gt;</description>
      <pubDate>Wed, 16 May 2018 13:06:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-Character-values-have-been-converted-to-numeric-values-at/m-p/462664#M117816</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-05-16T13:06:09Z</dc:date>
    </item>
    <item>
      <title>Re: Help: Character values have been converted to numeric values at the places given by:</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-Character-values-have-been-converted-to-numeric-values-at/m-p/462675#M117820</link>
      <description>&lt;P&gt;Hey thanks for your help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I did a proc content datastep and NIS_nummer is a numeric variable. How to transform it into a character variable?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And the variables I created allergy, antibiotics, antidiabetics ... should be character variable but are also defined as numeric variables. How can I change that?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 May 2018 13:19:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-Character-values-have-been-converted-to-numeric-values-at/m-p/462675#M117820</guid>
      <dc:creator>marysmith</dc:creator>
      <dc:date>2018-05-16T13:19:35Z</dc:date>
    </item>
    <item>
      <title>Re: Help: Character values have been converted to numeric values at the places given by:</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-Character-values-have-been-converted-to-numeric-values-at/m-p/462679#M117821</link>
      <description>&lt;P&gt;Right, there is your answer, nis_nummer is a numeric, and you are treating it as a character, hence why you get the warnings.&lt;/P&gt;
&lt;P&gt;Why do you want to convert it to character?&amp;nbsp; If you do, where did the data come from?&amp;nbsp; I would change the import process, I assume you read in an Excel (bad data format) file using proc import (guessing procedure), and have now ended up with something you didnt want, surprisingly!&amp;nbsp; As for making the other ones character, again why?&amp;nbsp; Are they defined before in the dataset, or are they new to this datastep, if new then simply declare them and use them as character.&amp;nbsp; Again, we are only seeing a tiny fragment of the whole, so can't really say, post test data in the form of a datastep, then show what you want out at the end, otherwise we are just guessing.&lt;/P&gt;</description>
      <pubDate>Wed, 16 May 2018 13:23:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-Character-values-have-been-converted-to-numeric-values-at/m-p/462679#M117821</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-05-16T13:23:58Z</dc:date>
    </item>
    <item>
      <title>Re: Help: Character values have been converted to numeric values at the places given by:</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-Character-values-have-been-converted-to-numeric-values-at/m-p/462685#M117823</link>
      <description>&lt;P&gt;thank you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;you are right NIS_Nummer is a numeric variable, but I thought it is a character variable. How do i convert it into a character variable?&lt;/P&gt;&lt;P&gt;thanks:)&lt;/P&gt;</description>
      <pubDate>Wed, 16 May 2018 13:31:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-Character-values-have-been-converted-to-numeric-values-at/m-p/462685#M117823</guid>
      <dc:creator>marysmith</dc:creator>
      <dc:date>2018-05-16T13:31:28Z</dc:date>
    </item>
    <item>
      <title>Re: Help: Character values have been converted to numeric values at the places given by:</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-Character-values-have-been-converted-to-numeric-values-at/m-p/462691#M117825</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/185853"&gt;@marysmith&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;thank you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;you are right NIS_Nummer is a numeric variable, but I thought it is a character variable. How do i convert it into a character variable?&lt;/P&gt;
&lt;P&gt;thanks:)&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Why would you want to? If it only contains 4-digit numbers below 8192, define it (at creation/import time) as numeric with length 3 (saving space), and you do not have to write all the quotes. If you have numbers up to 9999, you can still use length=4 and spare the quotes.&lt;/P&gt;
&lt;P&gt;If you really want to have it as character, define it so when data is read into SAS.&lt;/P&gt;</description>
      <pubDate>Wed, 16 May 2018 13:41:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-Character-values-have-been-converted-to-numeric-values-at/m-p/462691#M117825</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-05-16T13:41:32Z</dc:date>
    </item>
  </channel>
</rss>

