<?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 SAS numerical formats in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-numerical-formats/m-p/158934#M31020</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;I am using the SAS comma12. format. However some values have decimal points and some don't. &lt;/P&gt;&lt;P&gt;I would like to see two decimal places for those who have decimals and no demilas for those who don't.&lt;/P&gt;&lt;P&gt;For example, I would like to see: &lt;/P&gt;&lt;P&gt;12,987.23&lt;/P&gt;&lt;P&gt;365&lt;/P&gt;&lt;P&gt;45,525&lt;/P&gt;&lt;P&gt;145.60&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I change the format to comma12.2 then I get values like 365.00 which I don't want, and if I keep it as comma12. then I lose the decimals!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated.&lt;/P&gt;&lt;P&gt;Thank you &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>Thu, 28 Nov 2013 15:52:47 GMT</pubDate>
    <dc:creator>Shirin</dc:creator>
    <dc:date>2013-11-28T15:52:47Z</dc:date>
    <item>
      <title>SAS numerical formats</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-numerical-formats/m-p/158934#M31020</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;I am using the SAS comma12. format. However some values have decimal points and some don't. &lt;/P&gt;&lt;P&gt;I would like to see two decimal places for those who have decimals and no demilas for those who don't.&lt;/P&gt;&lt;P&gt;For example, I would like to see: &lt;/P&gt;&lt;P&gt;12,987.23&lt;/P&gt;&lt;P&gt;365&lt;/P&gt;&lt;P&gt;45,525&lt;/P&gt;&lt;P&gt;145.60&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I change the format to comma12.2 then I get values like 365.00 which I don't want, and if I keep it as comma12. then I lose the decimals!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated.&lt;/P&gt;&lt;P&gt;Thank you &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>Thu, 28 Nov 2013 15:52:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-numerical-formats/m-p/158934#M31020</guid>
      <dc:creator>Shirin</dc:creator>
      <dc:date>2013-11-28T15:52:47Z</dc:date>
    </item>
    <item>
      <title>Re: SAS numerical formats</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-numerical-formats/m-p/158935#M31021</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you really want to do that I think you probably need to write your function.&lt;/P&gt;&lt;P&gt;See:&amp;nbsp; &lt;A class="active_link" href="http://support.sas.com/documentation/cdl/en/proc/65145/HTML/default/viewer.htm#n1eyyzaux0ze5ln1k03gl338avbj.htm" title="http://support.sas.com/documentation/cdl/en/proc/65145/HTML/default/viewer.htm#n1eyyzaux0ze5ln1k03gl338avbj.htm"&gt;Using a Function to Format Values&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or you could use code to build your own string in a datastep and print that instead.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if num = int(num) then text=put(num,comma12.);&lt;/P&gt;&lt;P&gt;else text=put(num,comma12.2);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Nov 2013 16:52:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-numerical-formats/m-p/158935#M31021</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-11-28T16:52:33Z</dc:date>
    </item>
  </channel>
</rss>

