<?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 Numeric to character in SAS Viya</title>
    <link>https://communities.sas.com/t5/SAS-Viya/Numeric-to-character/m-p/880468#M1856</link>
    <description>&lt;P&gt;How do I convert to character from numeric. I am joining two tables and need them to BOTH be character.&amp;nbsp; I have tried the following and it is not converting:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data p_b; &lt;BR /&gt;set p.pcl ;&lt;BR /&gt;new_char = put(mednbr, 8.);&lt;BR /&gt;run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;I have also tried input: new_char= put(input(mednbr, 8.));&lt;/P&gt;
&lt;P&gt;that doesnt work either......&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 13 Jun 2023 16:20:52 GMT</pubDate>
    <dc:creator>bhca60</dc:creator>
    <dc:date>2023-06-13T16:20:52Z</dc:date>
    <item>
      <title>Numeric to character</title>
      <link>https://communities.sas.com/t5/SAS-Viya/Numeric-to-character/m-p/880468#M1856</link>
      <description>&lt;P&gt;How do I convert to character from numeric. I am joining two tables and need them to BOTH be character.&amp;nbsp; I have tried the following and it is not converting:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data p_b; &lt;BR /&gt;set p.pcl ;&lt;BR /&gt;new_char = put(mednbr, 8.);&lt;BR /&gt;run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;I have also tried input: new_char= put(input(mednbr, 8.));&lt;/P&gt;
&lt;P&gt;that doesnt work either......&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jun 2023 16:20:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/Numeric-to-character/m-p/880468#M1856</guid>
      <dc:creator>bhca60</dc:creator>
      <dc:date>2023-06-13T16:20:52Z</dc:date>
    </item>
    <item>
      <title>Re: Numeric to character</title>
      <link>https://communities.sas.com/t5/SAS-Viya/Numeric-to-character/m-p/880470#M1857</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/290946"&gt;@bhca60&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;How do I convert to character from numeric. I am joining two tables and need them to BOTH be character.&amp;nbsp; I have tried the following and it is not converting:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data p_b; &lt;BR /&gt;set p.pcl ;&lt;BR /&gt;new_char = put(mednbr, 8.);&lt;BR /&gt;run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;I have also tried input: new_char= put(input(mednbr, 8.));&lt;/P&gt;
&lt;P&gt;that doesnt work either......&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;FORMATs convert values to TEXT.&lt;/P&gt;
&lt;P&gt;INFORMATs convert TEXT to values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need to use a numeric INFORMAT with an INPUT() function call to convert characters string with TEXT into a numeric VALUE.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that the INPUT() function does not care if the WIDTH of the informat specification used is larger than the LENGTH of the character string being read.&amp;nbsp; 32 is the maximum number of bytes that the numeric informat can consume.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;new_char = input(mednbr, 32.);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jun 2023 16:24:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/Numeric-to-character/m-p/880470#M1857</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-06-13T16:24:45Z</dc:date>
    </item>
  </channel>
</rss>

