<?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: changing from 0 decimal to 2 decimal places in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/changing-from-0-decimal-to-2-decimal-places/m-p/203517#M50764</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think this is a misunderstanding of the formats.&amp;nbsp; In your example, the code 7.2 indicates that the maximum length of the value is 7 characters, with two of them being decimal.&amp;nbsp; Look at this a bit lke a string:&lt;/P&gt;&lt;P&gt;[] [] [] [] [] [] []&amp;nbsp;&amp;nbsp; - these are your 7 boxes for data&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; 1 0 0 . 0 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - 100 fits fine here as there is room for the whole part and the .00&lt;/P&gt;&lt;P&gt;9 5 0 2 0 0.&amp;nbsp;&amp;nbsp;&amp;nbsp; - As you can see here there is not width available for the .00&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So you need to specify a format length which is you largest value (character length) + 1 for the decimal place + 2 for the additional 2 zeroes.&amp;nbsp; So if you maximum value is 950200, that is 6, add the 1 and add the 2 = 9.2 should be your format.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 11 Jun 2015 14:48:53 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2015-06-11T14:48:53Z</dc:date>
    <item>
      <title>changing from 0 decimal to 2 decimal places</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/changing-from-0-decimal-to-2-decimal-places/m-p/203516#M50763</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 have some data that I geocoded and now I have a tract column that is defined as numeric with length of 8.&lt;/P&gt;&lt;P&gt;The format is BEST12. and the Informat is 12.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not sure why the format and informat use 12 when there are at most 6 digits in the values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to change the data from 999999 to 9999.00.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried this code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data x ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set geo_out ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; format tract&amp;nbsp; 7.2 ;&lt;/P&gt;&lt;P&gt;run ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This works for some of the numbers but not all.&amp;nbsp; For example&lt;/P&gt;&lt;P&gt;100 turned into 100.00&lt;/P&gt;&lt;P&gt;but 950200 stayed the same and doesn't have a decimal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Jun 2015 14:40:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/changing-from-0-decimal-to-2-decimal-places/m-p/203516#M50763</guid>
      <dc:creator>jerry898969</dc:creator>
      <dc:date>2015-06-11T14:40:37Z</dc:date>
    </item>
    <item>
      <title>Re: changing from 0 decimal to 2 decimal places</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/changing-from-0-decimal-to-2-decimal-places/m-p/203517#M50764</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think this is a misunderstanding of the formats.&amp;nbsp; In your example, the code 7.2 indicates that the maximum length of the value is 7 characters, with two of them being decimal.&amp;nbsp; Look at this a bit lke a string:&lt;/P&gt;&lt;P&gt;[] [] [] [] [] [] []&amp;nbsp;&amp;nbsp; - these are your 7 boxes for data&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; 1 0 0 . 0 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - 100 fits fine here as there is room for the whole part and the .00&lt;/P&gt;&lt;P&gt;9 5 0 2 0 0.&amp;nbsp;&amp;nbsp;&amp;nbsp; - As you can see here there is not width available for the .00&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So you need to specify a format length which is you largest value (character length) + 1 for the decimal place + 2 for the additional 2 zeroes.&amp;nbsp; So if you maximum value is 950200, that is 6, add the 1 and add the 2 = 9.2 should be your format.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Jun 2015 14:48:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/changing-from-0-decimal-to-2-decimal-places/m-p/203517#M50764</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-06-11T14:48:53Z</dc:date>
    </item>
    <item>
      <title>Re: changing from 0 decimal to 2 decimal places</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/changing-from-0-decimal-to-2-decimal-places/m-p/203518#M50765</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to use a longer width.&amp;nbsp; You have 6 digits to the left of the decimal so you will need to raise the width from 7 to at least 9 to allow for 6 places to the left, the decimal point and 2 places to the right.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Jun 2015 14:49:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/changing-from-0-decimal-to-2-decimal-places/m-p/203518#M50765</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2015-06-11T14:49:41Z</dc:date>
    </item>
    <item>
      <title>Re: changing from 0 decimal to 2 decimal places</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/changing-from-0-decimal-to-2-decimal-places/m-p/203519#M50766</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you both for your replies,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have to apologizes for a mistake I made in my original post. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The 100 needs to be 1.00.&amp;nbsp; I need to take the value and put a decimal point so there are 2 digits after the decimal place. &lt;/P&gt;&lt;P&gt;950200 should be 9502.00&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't need to add the extra .00 at the end it is part of the original value.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm sorry for the mistake.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Jun 2015 15:01:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/changing-from-0-decimal-to-2-decimal-places/m-p/203519#M50766</guid>
      <dc:creator>jerry898969</dc:creator>
      <dc:date>2015-06-11T15:01:33Z</dc:date>
    </item>
    <item>
      <title>Re: changing from 0 decimal to 2 decimal places</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/changing-from-0-decimal-to-2-decimal-places/m-p/203520#M50767</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you allowed to change the data values?&amp;nbsp; This combination might be the right one:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tract = tract/100;&lt;/P&gt;&lt;P&gt;format tract 7.2;&lt;/P&gt;&lt;P&gt;I'm assuming that your original post was wrong, and that 999999 should not print as 9999.00.&amp;nbsp; Rather it should print as 9999.99.&amp;nbsp; If it really should print as 9999.00 you would need to use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tract = int(tract/100);&lt;/P&gt;&lt;P&gt;format tract 7.2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It seems possible that this correction could have been earlier, when creating the original data set.&amp;nbsp; Good luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Jun 2015 15:55:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/changing-from-0-decimal-to-2-decimal-places/m-p/203520#M50767</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2015-06-11T15:55:57Z</dc:date>
    </item>
    <item>
      <title>Re: changing from 0 decimal to 2 decimal places</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/changing-from-0-decimal-to-2-decimal-places/m-p/203521#M50768</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you want to divide by 100 then just divide by 100.&amp;nbsp; But in that case 100 will become 1.00 and not 100.00.&lt;/P&gt;&lt;P&gt;Unless that is some information elsewhere that says what values should be divided by 100.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Jun 2015 17:51:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/changing-from-0-decimal-to-2-decimal-places/m-p/203521#M50768</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2015-06-11T17:51:55Z</dc:date>
    </item>
    <item>
      <title>Re: changing from 0 decimal to 2 decimal places</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/changing-from-0-decimal-to-2-decimal-places/m-p/203522#M50769</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 can't change the values.&amp;nbsp; The values range from 100 to 985900.&amp;nbsp; So I would need the results to be 1.00 and 9859.00.&amp;nbsp; I have to go in 2 places from the right of the value and put a decimal.&amp;nbsp;&amp;nbsp; I think the divide by 100 will do it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Taking this approach will the data change?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you both for all your help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Jun 2015 18:28:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/changing-from-0-decimal-to-2-decimal-places/m-p/203522#M50769</guid>
      <dc:creator>jerry898969</dc:creator>
      <dc:date>2015-06-11T18:28:59Z</dc:date>
    </item>
    <item>
      <title>Re: changing from 0 decimal to 2 decimal places</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/changing-from-0-decimal-to-2-decimal-places/m-p/203523#M50770</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you don't want to change the value then create a PICTURE format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc format;&lt;/P&gt;&lt;P&gt;picture myformat low-high='000009.99' (mult=1) ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt; data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input x;&lt;/P&gt;&lt;P&gt;&amp;nbsp; put x 7.2 +1 x myformat. ;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;100&lt;/P&gt;&lt;P&gt;567890&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; 100.00 1.00&lt;/P&gt;&lt;P&gt; 567890 5678.90&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Jun 2015 22:20:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/changing-from-0-decimal-to-2-decimal-places/m-p/203523#M50770</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2015-06-11T22:20:35Z</dc:date>
    </item>
  </channel>
</rss>

