<?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: converting numeric value to character error in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/converting-numeric-value-to-character-error/m-p/91443#M8491</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you just need to add a $, i.e. length=$5&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 28 Mar 2013 14:48:08 GMT</pubDate>
    <dc:creator>art297</dc:creator>
    <dc:date>2013-03-28T14:48:08Z</dc:date>
    <item>
      <title>converting numeric value to character error</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/converting-numeric-value-to-character-error/m-p/91442#M8490</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys, need help plz.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I &lt;STRONG&gt;convert&lt;/STRONG&gt; variable 'b' from &lt;STRONG&gt;numeric to character&lt;/STRONG&gt; by applying following code and then drop 'b' and then rename a=b.&lt;/P&gt;&lt;P&gt;then try to &lt;STRONG&gt;bring&lt;/STRONG&gt; b as first variable in dataset by using 'attrib' funtion but getting following error msg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="text-decoration: underline;"&gt;can you plz help? &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data check2;&lt;/P&gt;&lt;P&gt;set check1;&lt;/P&gt;&lt;P&gt;a=put(b,5.);&lt;/P&gt;&lt;P&gt;drop b;&lt;/P&gt;&lt;P&gt;rename a=b;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data check3;&lt;/P&gt;&lt;P&gt;attrib b length=5;&lt;/P&gt;&lt;P&gt;set check2;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ERROR: variable B has been defined as both character and numeric.&lt;/P&gt;&lt;P&gt;&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>Thu, 28 Mar 2013 14:15:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/converting-numeric-value-to-character-error/m-p/91442#M8490</guid>
      <dc:creator>sas_9</dc:creator>
      <dc:date>2013-03-28T14:15:00Z</dc:date>
    </item>
    <item>
      <title>Re: converting numeric value to character error</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/converting-numeric-value-to-character-error/m-p/91443#M8491</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you just need to add a $, i.e. length=$5&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Mar 2013 14:48:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/converting-numeric-value-to-character-error/m-p/91443#M8491</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2013-03-28T14:48:08Z</dc:date>
    </item>
    <item>
      <title>Re: converting numeric value to character error</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/converting-numeric-value-to-character-error/m-p/91444#M8492</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;hello sir, I did try this and it worked. I didn't drop and rename, used 'retain' function and didn't use 'length' statement ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data check2;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;set check1;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;a=put(b,5.);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data check3;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;retain b;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;set check2;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Mar 2013 14:58:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/converting-numeric-value-to-character-error/m-p/91444#M8492</guid>
      <dc:creator>sas_9</dc:creator>
      <dc:date>2013-03-28T14:58:55Z</dc:date>
    </item>
    <item>
      <title>Re: converting numeric value to character error</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/converting-numeric-value-to-character-error/m-p/91445#M8493</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Either would have worked.&amp;nbsp; However, I hope you just forgot to post the rename statement as, otherwise, the code you showed would create the new character variable a, but then put the old numeric variable b in the first position.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Mar 2013 15:07:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/converting-numeric-value-to-character-error/m-p/91445#M8493</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2013-03-28T15:07:19Z</dc:date>
    </item>
    <item>
      <title>Re: converting numeric value to character error</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/converting-numeric-value-to-character-error/m-p/91446#M8494</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yes sir, that is correct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your comment!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Mar 2013 15:13:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/converting-numeric-value-to-character-error/m-p/91446#M8494</guid>
      <dc:creator>sas_9</dc:creator>
      <dc:date>2013-03-28T15:13:45Z</dc:date>
    </item>
    <item>
      <title>Re: converting numeric value to character error</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/converting-numeric-value-to-character-error/m-p/91447#M8495</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here are some samples from support.sas.com that may be useful:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sample &lt;EM&gt;40700: &lt;/EM&gt;How to convert all character variables to numeric and use the same variable names in the output data set&lt;/P&gt;&lt;P&gt;&lt;SPAN style="padding: 0px 5px;"&gt;&lt;A href="http://support.sas.com/kb/40700" target="_blank"&gt;http://support.sas.com/kb/40700&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sample &lt;EM&gt;24590: &lt;/EM&gt;Convert values from character to numeric or from numeric to character&lt;/P&gt;&lt;P&gt;&lt;SPAN style="padding: 0px 5px;"&gt;&lt;A href="http://support.sas.com/kb/24590" target="_blank"&gt;http://support.sas.com/kb/24590&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sample &lt;EM&gt;43052: &lt;/EM&gt;Convert variables containing only numeric values from type character to numeric&lt;/P&gt;&lt;P&gt;&lt;SPAN style="padding: 0px 5px;"&gt;&lt;A href="http://support.sas.com/kb/43052" target="_blank"&gt;http://support.sas.com/kb/43052&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Mar 2013 15:18:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/converting-numeric-value-to-character-error/m-p/91447#M8495</guid>
      <dc:creator>jwsquillace</dc:creator>
      <dc:date>2013-03-28T15:18:21Z</dc:date>
    </item>
    <item>
      <title>Re: converting numeric value to character error</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/converting-numeric-value-to-character-error/m-p/91448#M8496</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This will work without having to read the data twice.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;data check2;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;&amp;nbsp;&amp;nbsp; set check1(rename=(b=tempb));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;&amp;nbsp;&amp;nbsp; b=put(tempb,5.);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;&amp;nbsp;&amp;nbsp; drop tempb;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Mar 2013 15:24:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/converting-numeric-value-to-character-error/m-p/91448#M8496</guid>
      <dc:creator>Larry_S_sas</dc:creator>
      <dc:date>2013-03-28T15:24:29Z</dc:date>
    </item>
    <item>
      <title>Re: converting numeric value to character error</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/converting-numeric-value-to-character-error/m-p/91449#M8497</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Larry,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It would need one additional statement in order to satisfy the OP's needs:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;data check2;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; attrib b length=$5;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set check1(rename=(b=tempb));&lt;/P&gt;&lt;P&gt;&amp;nbsp; b=put(tempb,5.);&lt;/P&gt;&lt;P&gt;&amp;nbsp; drop tempb;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Mar 2013 15:41:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/converting-numeric-value-to-character-error/m-p/91449#M8497</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2013-03-28T15:41:37Z</dc:date>
    </item>
    <item>
      <title>Re: converting numeric value to character error</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/converting-numeric-value-to-character-error/m-p/91450#M8498</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The put function would create a character variable of length 5 because of the $5. format in the put function. the attrib is not needed. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Mar 2013 15:47:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/converting-numeric-value-to-character-error/m-p/91450#M8498</guid>
      <dc:creator>Larry_S_sas</dc:creator>
      <dc:date>2013-03-28T15:47:36Z</dc:date>
    </item>
    <item>
      <title>Re: converting numeric value to character error</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/converting-numeric-value-to-character-error/m-p/91451#M8499</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The attrib statement (or any statement that would reorder variables) is needed because the OP wanted variable b to be placed in the first position.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Mar 2013 15:50:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/converting-numeric-value-to-character-error/m-p/91451#M8499</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2013-03-28T15:50:00Z</dc:date>
    </item>
    <item>
      <title>Re: converting numeric value to character error</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/converting-numeric-value-to-character-error/m-p/91452#M8500</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sorry, i missed that the variable needed to be he first inorder. You are correct.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Mar 2013 15:54:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/converting-numeric-value-to-character-error/m-p/91452#M8500</guid>
      <dc:creator>Larry_S_sas</dc:creator>
      <dc:date>2013-03-28T15:54:28Z</dc:date>
    </item>
    <item>
      <title>Re: converting numeric value to character error</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/converting-numeric-value-to-character-error/m-p/91453#M8501</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks all for your comment...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Mar 2013 14:06:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/converting-numeric-value-to-character-error/m-p/91453#M8501</guid>
      <dc:creator>sas_9</dc:creator>
      <dc:date>2013-03-29T14:06:46Z</dc:date>
    </item>
  </channel>
</rss>

