<?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 How to convert numeric values to characters without adding blanks in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-convert-numeric-values-to-characters-without-adding/m-p/42323#M11002</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could also use -L with the PUT function.&amp;nbsp; PUT(AGE,2.-L) &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 07 Nov 2011 14:22:29 GMT</pubDate>
    <dc:creator>data_null__</dc:creator>
    <dc:date>2011-11-07T14:22:29Z</dc:date>
    <item>
      <title>How to convert numeric values to characters without adding blanks</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-convert-numeric-values-to-characters-without-adding/m-p/42321#M11000</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello &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;P&gt;&lt;/P&gt;&lt;P&gt;I have a numeric variable x with values ranging from 1, 2 to 25. If I simply use: y = PUT(x,&amp;nbsp; 2.) then there will be one blank space for those x with one single digit, because the PUT function makes the length of 2 for all y.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My question is: how can I make this conversion without adding any blanks to y?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Nov 2011 13:47:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-convert-numeric-values-to-characters-without-adding/m-p/42321#M11000</guid>
      <dc:creator>bncoxuk</dc:creator>
      <dc:date>2011-11-07T13:47:57Z</dc:date>
    </item>
    <item>
      <title>How to convert numeric values to characters without adding blanks</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-convert-numeric-values-to-characters-without-adding/m-p/42322#M11001</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you were outputting the data to a text file, I'd suggest using the -l modifier.&amp;nbsp; However, if you simply want to remove the extra spaces in the data itself, you could always just "strip" them.&amp;nbsp; e.g.,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data test;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set sashelp.class;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if _n_ lt 6 then age=_n_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; age1char=put(age,2.);&lt;/P&gt;&lt;P&gt;&amp;nbsp; age2char=strip(put(age,2.));&lt;/P&gt;&lt;P&gt;&amp;nbsp; x=length(age1char);&lt;/P&gt;&lt;P&gt;&amp;nbsp; y=length(age2char);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Nov 2011 14:00:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-convert-numeric-values-to-characters-without-adding/m-p/42322#M11001</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-11-07T14:00:06Z</dc:date>
    </item>
    <item>
      <title>How to convert numeric values to characters without adding blanks</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-convert-numeric-values-to-characters-without-adding/m-p/42323#M11002</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could also use -L with the PUT function.&amp;nbsp; PUT(AGE,2.-L) &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Nov 2011 14:22:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-convert-numeric-values-to-characters-without-adding/m-p/42323#M11002</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2011-11-07T14:22:29Z</dc:date>
    </item>
    <item>
      <title>How to convert numeric values to characters without adding blanks</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-convert-numeric-values-to-characters-without-adding/m-p/42324#M11003</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;DN, Totally agree!&amp;nbsp; But, I think it is really just a matter of preference as there is virtually NO performance difference between the two methods (at least when tested on 1.9 million records).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Nov 2011 14:42:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-convert-numeric-values-to-characters-without-adding/m-p/42324#M11003</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-11-07T14:42:35Z</dc:date>
    </item>
  </channel>
</rss>

