<?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: Format numeric variable when transformed to character in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Format-numeric-variable-when-transformed-to-character/m-p/125264#M260153</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;use the put function&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 27 Oct 2013 20:50:48 GMT</pubDate>
    <dc:creator>jakarman</dc:creator>
    <dc:date>2013-10-27T20:50:48Z</dc:date>
    <item>
      <title>Format numeric variable when transformed to character</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Format-numeric-variable-when-transformed-to-character/m-p/125263#M260152</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From a proc tabulate , I get the average score of a variable for levels of of a class variable then I create a character variable that include all these values as a string&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;retain seriesYou seriesOthers&amp;nbsp; ;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; seriesYou = catx(',',seriesYou,&amp;amp;YouAsDirMgr) ;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is that the values in the sting appear unformatted (3.31131313,4.4546464656....) while I want them to appear as (3.31,4.45...)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Abe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 27 Oct 2013 16:29:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Format-numeric-variable-when-transformed-to-character/m-p/125263#M260152</guid>
      <dc:creator>EzPaste</dc:creator>
      <dc:date>2013-10-27T16:29:20Z</dc:date>
    </item>
    <item>
      <title>Re: Format numeric variable when transformed to character</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Format-numeric-variable-when-transformed-to-character/m-p/125264#M260153</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;use the put function&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 27 Oct 2013 20:50:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Format-numeric-variable-when-transformed-to-character/m-p/125264#M260153</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2013-10-27T20:50:48Z</dc:date>
    </item>
    <item>
      <title>Re: Format numeric variable when transformed to character</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Format-numeric-variable-when-transformed-to-character/m-p/125265#M260154</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If I understand what &amp;amp;YouAsDirMgr might contain (a list of variable names or numbers), you could use it in the list form of a DO loop :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;%let YouAsDirMgr=a,b,123.12345;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data _null_;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;length str $200;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;a = 345.876543;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;b = 987;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;seriesYou = 9.9889;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;do v = seriesYou, &amp;amp;YouAsDirMgr.;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; str = catx(",", str, round(v, 0.01));&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;put str=;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Oct 2013 01:03:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Format-numeric-variable-when-transformed-to-character/m-p/125265#M260154</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2013-10-28T01:03:03Z</dc:date>
    </item>
  </channel>
</rss>

