<?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: Why this warning in numeric to charactoer conversion? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Why-this-warning-in-numeric-to-charactoer-conversion/m-p/121241#M33433</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The warning message is because you tried to apply a character format ($32.) to a numeric variable.&amp;nbsp; Use a numeric format like 32. instead.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 26 Feb 2013 00:14:40 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2013-02-26T00:14:40Z</dc:date>
    <item>
      <title>Why this warning in numeric to charactoer conversion?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Why-this-warning-in-numeric-to-charactoer-conversion/m-p/121238#M33430</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 11pt; background: white; font-family: 'Courier New';"&gt;Hi SAS Forum,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 11pt; background: white; font-family: 'Courier New';"&gt;The&amp;nbsp; variable named “account_number” in dataset A is a numeric (it is sure).&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 11pt; background: white; font-family: 'Courier New';"&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 11pt; background: white; font-family: 'Courier New';"&gt;I wanted to convert it into a character.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 11pt; background: white; font-family: 'Courier New';"&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 11pt; background: white; font-family: 'Courier New';"&gt;I used this code.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 11pt; background: white; font-family: 'Courier New';"&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 11pt; background: white; font-family: 'Courier New';"&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 11pt; background: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt; B (&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 11pt;"&gt;rename&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt;=(account_number_new=account_number));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 11pt;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt; A;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; account_number_new=left(put(account_number, &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: teal; font-size: 11pt;"&gt;$32.&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt;));&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: green; font-size: 11pt;"&gt;/*to convert to character;*/&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 11pt;"&gt;drop&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt; account_number;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 11pt; background: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt;Question:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt;This warning comes but conversion happened.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: teal; font-size: 11pt;"&gt;WARNING: Variable ACCOUNT_NUMBER has already been defined as numeric.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: teal; font-size: 11pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: teal; font-size: 11pt;"&gt;Could anyone help me to understand why this warning?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: teal; font-size: 11pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: teal; font-size: 11pt;"&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: teal; font-size: 11pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: teal; font-size: 11pt;"&gt;Mirisage&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Feb 2013 21:53:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Why-this-warning-in-numeric-to-charactoer-conversion/m-p/121238#M33430</guid>
      <dc:creator>Mirisage</dc:creator>
      <dc:date>2013-02-25T21:53:21Z</dc:date>
    </item>
    <item>
      <title>Re: Why this warning in numeric to charactoer conversion?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Why-this-warning-in-numeric-to-charactoer-conversion/m-p/121239#M33431</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Should be&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt;account_number_new=left(put(account_number, &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: teal; font-size: 11pt;"&gt;32.&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt;));&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: green; font-size: 11pt;"&gt;/*to convert to character;*/&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Feb 2013 21:53:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Why-this-warning-in-numeric-to-charactoer-conversion/m-p/121239#M33431</guid>
      <dc:creator>DBailey</dc:creator>
      <dc:date>2013-02-25T21:53:54Z</dc:date>
    </item>
    <item>
      <title>Re: Why this warning in numeric to charactoer conversion?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Why-this-warning-in-numeric-to-charactoer-conversion/m-p/121240#M33432</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You're going to get the warning regardless, but you should be able to ignore it.&amp;nbsp; If your PROC Contents shows the variable you want coming out as character, you're doing fine.&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Feb 2013 00:11:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Why-this-warning-in-numeric-to-charactoer-conversion/m-p/121240#M33432</guid>
      <dc:creator>TashaChapman</dc:creator>
      <dc:date>2013-02-26T00:11:11Z</dc:date>
    </item>
    <item>
      <title>Re: Why this warning in numeric to charactoer conversion?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Why-this-warning-in-numeric-to-charactoer-conversion/m-p/121241#M33433</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The warning message is because you tried to apply a character format ($32.) to a numeric variable.&amp;nbsp; Use a numeric format like 32. instead.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Feb 2013 00:14:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Why-this-warning-in-numeric-to-charactoer-conversion/m-p/121241#M33433</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-02-26T00:14:40Z</dc:date>
    </item>
    <item>
      <title>Re: Why this warning in numeric to charactoer conversion?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Why-this-warning-in-numeric-to-charactoer-conversion/m-p/121242#M33434</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Duh! &amp;lt;smacks self on head&amp;gt; Tom is totally right.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You're using a character informat and applying it to a numeric variable.&amp;nbsp; The informat that you use in your PUT function should be the same variable type as the incoming source data (in this case numeric).&amp;nbsp; It will still output the new variable as character.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I said was also technically kind of true, but that's just because SAS was being nice and forgiving, not because your code was technically correct. &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Feb 2013 00:28:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Why-this-warning-in-numeric-to-charactoer-conversion/m-p/121242#M33434</guid>
      <dc:creator>TashaChapman</dc:creator>
      <dc:date>2013-02-26T00:28:08Z</dc:date>
    </item>
    <item>
      <title>Re: Why this warning in numeric to charactoer conversion?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Why-this-warning-in-numeric-to-charactoer-conversion/m-p/121243#M33435</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi DBailey, Tom and Tasha,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks to eveyone of you for this help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mirisage&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Feb 2013 03:29:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Why-this-warning-in-numeric-to-charactoer-conversion/m-p/121243#M33435</guid>
      <dc:creator>Mirisage</dc:creator>
      <dc:date>2013-02-26T03:29:16Z</dc:date>
    </item>
  </channel>
</rss>

