<?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: z19. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/z19/m-p/874983#M345723</link>
    <description>&lt;P&gt;Z19. is a format specification.&amp;nbsp; Just like DATE9. is a format specification.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Z is the name of the format.&amp;nbsp; 19 is the width you want it to use to display the value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You use the Z format to display integers with leading zeros.&amp;nbsp; So whatever magnitude the value has it will always print with 19 digits adding zeros in the front if needed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But remember that SAS stores all numbers as 64 bit binary floating point values.&amp;nbsp; So the largest integer it can store before you start seeing gaps is smaller than 19 digits long.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;9077   data _null_;
9078     exactint = constant('exactint');
9079     put exactint Z19.;
9080   run;

0009007199254740992
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;So if you have any numbers that are larger than&amp;nbsp;9,007,199,254,740,992 then you cannot count on all of those digits being properly stored as a number.&amp;nbsp; &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That is one reason why it would have been better to have created the variable as character to begin with, to avoid loss of precision in the value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 10 May 2023 14:53:32 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2023-05-10T14:53:32Z</dc:date>
    <item>
      <title>z19.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/z19/m-p/874888#M345692</link>
      <description>&lt;P&gt;hi what does the following do&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/* am='6223460604630016' */&lt;/P&gt;
&lt;P&gt;put (am,z19.) as ambs&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2023 11:05:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/z19/m-p/874888#M345692</guid>
      <dc:creator>HeatherNewton</dc:creator>
      <dc:date>2023-05-10T11:05:05Z</dc:date>
    </item>
    <item>
      <title>Re: z19.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/z19/m-p/874889#M345693</link>
      <description>&lt;P&gt;It creates a character variable ambs that is the value of am with leading zeros up to a length of 19, using the &lt;A href="https://documentation.sas.com/doc/da/vdmmlcdc/8.1/ds2ref/p1h8l8v2o11xhnn1oue05oue1hvx.htm" target="_self"&gt;Z Format&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2023 11:09:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/z19/m-p/874889#M345693</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2023-05-10T11:09:05Z</dc:date>
    </item>
    <item>
      <title>Re: z19.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/z19/m-p/874894#M345694</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/416388"&gt;@HeatherNewton&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;hi what does the following do&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/* am='6223460604630016' */&lt;/P&gt;
&lt;P&gt;put (am,z19.) as ambs&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The best answer is for you to try it and see what happens.&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2023 11:37:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/z19/m-p/874894#M345694</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-05-10T11:37:55Z</dc:date>
    </item>
    <item>
      <title>Re: z19.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/z19/m-p/874904#M345697</link>
      <description>&lt;P&gt;Looks like an attempt to fix the mistake of storing codes as a number, but this is bound to fail anyway, see this example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
am = 9223460604630017;
format am 19.;
ambs = put(am,z19.);
put am= / ambs=;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Run it, and read the log.&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2023 12:09:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/z19/m-p/874904#M345697</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-05-10T12:09:51Z</dc:date>
    </item>
    <item>
      <title>Re: z19.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/z19/m-p/874975#M345721</link>
      <description>&lt;P&gt;What does z19. Means&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i thought it mean to add 3 zero in front so becomes 19 digits, am I right.&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2023 14:44:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/z19/m-p/874975#M345721</guid>
      <dc:creator>HeatherNewton</dc:creator>
      <dc:date>2023-05-10T14:44:55Z</dc:date>
    </item>
    <item>
      <title>Re: z19.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/z19/m-p/874983#M345723</link>
      <description>&lt;P&gt;Z19. is a format specification.&amp;nbsp; Just like DATE9. is a format specification.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Z is the name of the format.&amp;nbsp; 19 is the width you want it to use to display the value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You use the Z format to display integers with leading zeros.&amp;nbsp; So whatever magnitude the value has it will always print with 19 digits adding zeros in the front if needed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But remember that SAS stores all numbers as 64 bit binary floating point values.&amp;nbsp; So the largest integer it can store before you start seeing gaps is smaller than 19 digits long.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;9077   data _null_;
9078     exactint = constant('exactint');
9079     put exactint Z19.;
9080   run;

0009007199254740992
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;So if you have any numbers that are larger than&amp;nbsp;9,007,199,254,740,992 then you cannot count on all of those digits being properly stored as a number.&amp;nbsp; &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That is one reason why it would have been better to have created the variable as character to begin with, to avoid loss of precision in the value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2023 14:53:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/z19/m-p/874983#M345723</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-05-10T14:53:32Z</dc:date>
    </item>
    <item>
      <title>Re: z19.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/z19/m-p/874986#M345726</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/416388"&gt;@HeatherNewton&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;What does z19. Means&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i thought it mean to add 3 zero in front so becomes 19 digits, am I right.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Not necessarily if the variable is defined a CHARACTER as shown in your example. A numeric format cannot be used with a Character value and would result in an ERROR of the form "Format $Z not found". Unless somewhere you have a custom character format named Z in your current format search path. At which point I have no idea what the result might be as we would need the definition of that format.&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2023 14:58:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/z19/m-p/874986#M345726</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-05-10T14:58:33Z</dc:date>
    </item>
  </channel>
</rss>

