<?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: PDx format in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/PDx-format/m-p/704472#M215962</link>
    <description>Thank you very much for the precision.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;So it means that if we use a PD6 format , we can have any number between 0 and 999&amp;nbsp;&amp;nbsp;999 999 999.&lt;BR /&gt;&lt;BR /&gt;What will happen if the number is bigger then&amp;nbsp;999&amp;nbsp;&amp;nbsp;999 999 999?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Regards,</description>
    <pubDate>Tue, 08 Dec 2020 17:49:04 GMT</pubDate>
    <dc:creator>alepage</dc:creator>
    <dc:date>2020-12-08T17:49:04Z</dc:date>
    <item>
      <title>PDx format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PDx-format/m-p/704461#M215959</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does someone know how many significant digits do we have using a PD.6 format.&lt;/P&gt;
&lt;P&gt;Could it be possible to get a table showing the number of significant digits for each PD.x format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Dec 2020 17:20:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PDx-format/m-p/704461#M215959</guid>
      <dc:creator>alepage</dc:creator>
      <dc:date>2020-12-08T17:20:33Z</dc:date>
    </item>
    <item>
      <title>Re: PDx format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PDx-format/m-p/704462#M215960</link>
      <description>&lt;P&gt;Digits or significant digits? Not the same thing. The significant digits are use specific.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The W is the number of BYTES in the output, and each byte has two digits. So PD6. = 12 digits.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Dec 2020 17:24:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PDx-format/m-p/704462#M215960</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-12-08T17:24:38Z</dc:date>
    </item>
    <item>
      <title>Re: PDx format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PDx-format/m-p/704472#M215962</link>
      <description>Thank you very much for the precision.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;So it means that if we use a PD6 format , we can have any number between 0 and 999&amp;nbsp;&amp;nbsp;999 999 999.&lt;BR /&gt;&lt;BR /&gt;What will happen if the number is bigger then&amp;nbsp;999&amp;nbsp;&amp;nbsp;999 999 999?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Regards,</description>
      <pubDate>Tue, 08 Dec 2020 17:49:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PDx-format/m-p/704472#M215962</guid>
      <dc:creator>alepage</dc:creator>
      <dc:date>2020-12-08T17:49:04Z</dc:date>
    </item>
    <item>
      <title>Re: PDx format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PDx-format/m-p/704481#M215968</link>
      <description>&lt;P&gt;Try it:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;length checkvar $12;
checkvar = put(put(1234567123456,pd6.),$hex12.);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 08 Dec 2020 17:59:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PDx-format/m-p/704481#M215968</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-12-08T17:59:41Z</dc:date>
    </item>
    <item>
      <title>Re: PDx format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PDx-format/m-p/704510#M215984</link>
      <description>I though that PD6 could take 12 digits.  It is not the case?&lt;BR /&gt;&lt;BR /&gt;/*11 digits*/&lt;BR /&gt;data test;&lt;BR /&gt;length checkvar $12;&lt;BR /&gt;checkvar = put(put(12345671234,pd6.),$hex12.);&lt;BR /&gt;&lt;BR /&gt;/*10 digits*/&lt;BR /&gt;&lt;BR /&gt;length checkvar1 $12;&lt;BR /&gt;checkvar1 = put(put(1234567899,pd6.),$hex12.);&lt;BR /&gt;run;</description>
      <pubDate>Tue, 08 Dec 2020 18:55:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PDx-format/m-p/704510#M215984</guid>
      <dc:creator>alepage</dc:creator>
      <dc:date>2020-12-08T18:55:08Z</dc:date>
    </item>
    <item>
      <title>Re: PDx format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PDx-format/m-p/704591#M216009</link>
      <description>&lt;P&gt;You are not starting with a packed decimal value.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Dec 2020 23:45:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PDx-format/m-p/704591#M216009</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-12-08T23:45:25Z</dc:date>
    </item>
    <item>
      <title>Re: PDx format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PDx-format/m-p/704678#M216050</link>
      <description>&lt;P&gt;I ran this test:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
length checkvar $12;
input number;
checkvar = put(put(number,pd6.),$hex12.);
datalines;
123456789
-123456789
1234567890
-1234567890
12345678901
123456789012
1234567890123
;

proc print data=test;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and got this result:&lt;/P&gt;
&lt;PRE&gt;Beob.      checkvar             number

  1      000123456789        123456789
  2      800123456789       -123456789
  3      001234567890       1234567890
  4      801234567890      -1234567890
  5      009999999999      12345678901
  6      009999999999     123456789012
  7      009999999999    1234567890123
&lt;/PRE&gt;
&lt;P&gt;So it can be seen that a full byte is reserved for the (possible) sign. This behavior is described in the OS-specific documentation of the PD format:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.5&amp;amp;docsetId=hostunx&amp;amp;docsetTarget=p1tyhyo2aep8utn1vkzk6x0jgnf0.htm&amp;amp;locale=en" target="_blank" rel="noopener"&gt;UNIX&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.5&amp;amp;docsetId=hostwin&amp;amp;docsetTarget=p0wpvq33gtw3ofn1957nv86us4rb.htm&amp;amp;locale=en" target="_blank" rel="noopener"&gt;Windows&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Dec 2020 10:33:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PDx-format/m-p/704678#M216050</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-12-09T10:33:34Z</dc:date>
    </item>
  </channel>
</rss>

