<?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: Dx.p format - in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Dx-p-format/m-p/593584#M170372</link>
    <description>&lt;P&gt;The same code yields 19 zeros for me.&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;%put &amp;amp;=sysscpl &amp;amp;=sysvlong %sysfunc(putn(12345,D32.9));&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;SYSSCPL=X64_SRV12 SYSVLONG=9.04.01M2P072314 12345.0000000000000000000&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 03 Oct 2019 03:40:20 GMT</pubDate>
    <dc:creator>ChrisNZ</dc:creator>
    <dc:date>2019-10-03T03:40:20Z</dc:date>
    <item>
      <title>Dx.p format -</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Dx-p-format/m-p/593383#M170279</link>
      <description>&lt;P&gt;Trying to make sense of the "D" numeric format, and when best to use it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And why a "&lt;STRONG&gt;put(12345,D32.9)&lt;/STRONG&gt;" yields "&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;STRONG&gt;12345.0000000000000000&lt;/STRONG&gt;" (16 zeroes)?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Why use D32.9 when I could use 32.16?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The documentation seems a bit hard to decypher (summary below).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any assistance appreciated - use cases, perhaps?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/leforinforref/64790/HTML/default/viewer.htm#p14hdw0zjbxr9tn1an4mgxor9pc2.htm" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;Dx.p format - SAS(R) 9.4 Formats and Informats: Reference&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Prints numeric values, possibly with a great range of values, lining up decimal places for values of similar magnitude.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Details - The Dw.p format writes numbers so that the decimal point aligns in groups of values with similar magnitude. Larger values of p print the data values with more precision and potentially more shifts in the decimal point alignment. Smaller values of p print the data values with less precision and a greater chance of decimal point alignment.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Comparisons&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;The BESTw. format writes as many significant digits as possible in the output field, but if the numbers vary in magnitude, the decimal points do not line up.&lt;/LI&gt;
&lt;LI&gt;Dw.p writes numbers with the desired precision and more alignment than the BESTw format.&lt;/LI&gt;
&lt;LI&gt;The BESTDw.p format is a combination of the BESTw. format and the Dw.p format in that it formats all numeric data, and it does a better job of aligning decimals than the BESTw. format.&lt;/LI&gt;
&lt;LI&gt;The w.d format aligns decimal points, if possible, but it does not necessarily show the same precision for all numbers.&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Wed, 02 Oct 2019 14:22:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Dx-p-format/m-p/593383#M170279</guid>
      <dc:creator>AndrewHowell</dc:creator>
      <dc:date>2019-10-02T14:22:41Z</dc:date>
    </item>
    <item>
      <title>Re: Dx.p format -</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Dx-p-format/m-p/593584#M170372</link>
      <description>&lt;P&gt;The same code yields 19 zeros for me.&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;%put &amp;amp;=sysscpl &amp;amp;=sysvlong %sysfunc(putn(12345,D32.9));&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;SYSSCPL=X64_SRV12 SYSVLONG=9.04.01M2P072314 12345.0000000000000000000&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Oct 2019 03:40:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Dx-p-format/m-p/593584#M170372</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2019-10-03T03:40:20Z</dc:date>
    </item>
    <item>
      <title>Re: Dx.p format -</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Dx-p-format/m-p/593658#M170404</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16961"&gt;@ChrisNZ&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've tried 32.0 up to 32.9 (32.0 is same as 32.3). The result is still MORE decimals than&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So I guess I'm looking for clear documentation on what the "D" format is actually &lt;STRONG&gt;FOR&lt;/STRONG&gt;, and how to know - with certainty - what the output would be for various values of width and/or decimal.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Background: I'm storing the result in strings, and I need to know the length of the strings and the placement of the decimal point.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Oct 2019 09:45:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Dx-p-format/m-p/593658#M170404</guid>
      <dc:creator>AndrewHowell</dc:creator>
      <dc:date>2019-10-03T09:45:10Z</dc:date>
    </item>
    <item>
      <title>Re: Dx.p format -</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Dx-p-format/m-p/593949#M170567</link>
      <description>&lt;P&gt;&amp;gt;&amp;nbsp;&lt;EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;I need to know the length of the strings and the placement of the decimal point.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Why use format Dw.p then?&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Its description&lt;/P&gt;
&lt;P class="xis-shortDescription"&gt;&lt;STRONG&gt;Prints numeric values, possibly with a great range of values, lining up decimal places for values of similar magnitude.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;is enticing for your purpose, but the small-print caveat&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Smaller values of&amp;nbsp;&lt;SPAN class="xis-userSuppliedValue"&gt;p&lt;/SPAN&gt;&amp;nbsp;print the data values with less precision and a greater chance of decimal point alignment.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;includes the word &lt;EM&gt;chance&lt;/EM&gt;, which is not what you seem to want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A fixed format like w.d seems more suitable for your purpose, doesn't it?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I never used format Dw.p before, so am unsure how precision parameter works. As you rightly point out, the documentation is rather terse on the matter.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Oct 2019 21:34:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Dx-p-format/m-p/593949#M170567</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2019-10-03T21:34:17Z</dc:date>
    </item>
  </channel>
</rss>

