<?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: Retain Trailing Zeros in Numeric Variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Retain-Trailing-Zeros-in-Numeric-Variables/m-p/963741#M375410</link>
    <description>&lt;P&gt;Another option might be to use &lt;EM&gt;leading&lt;/EM&gt; zeros for subversions &amp;lt;10, i.e., 8.01, 8.02, etc., and then to use a format such as &lt;FONT face="courier new,courier"&gt;6.2&lt;/FONT&gt; to display 8.1 as 8.10.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using a character variable is still the more robust solution, though. I have seen numeric non-integer values with a similar purpose in a clinical database which surprisingly were affected by tiny rounding errors (or numeric representation errors from the external database) so that testing exact equality (as in "&lt;FONT face="courier new,courier"&gt;if version=8.01 then&lt;/FONT&gt; ...") failed.&lt;/P&gt;</description>
    <pubDate>Tue, 08 Apr 2025 18:24:03 GMT</pubDate>
    <dc:creator>FreelanceReinh</dc:creator>
    <dc:date>2025-04-08T18:24:03Z</dc:date>
    <item>
      <title>Retain Trailing Zeros in Numeric Variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Retain-Trailing-Zeros-in-Numeric-Variables/m-p/963719#M375404</link>
      <description>&lt;P&gt;I have a situation where we are storing the protocol version on which a subject is enrolled, and we noticed that SAS is truncating trailing zeros.&amp;nbsp; For example, there are at least 10 subversions of a protocol, so one subject was enrolled on version 8.1 while another was enrolled on version 8.10.&amp;nbsp; When SAS brings in this data, it&amp;nbsp; understandably converts 8.10 to 8.1, but they aren't the same value.&amp;nbsp; Is there a format that could be applied to retain this?&amp;nbsp; I have a feeling that the only solution is to store the protocol version as a character string, but before I have our database designer revamp things (if even possible at this point), I wanted to see if there was an alternative function or format in SAS.&amp;nbsp; I can't imagine that SAS can tell the difference between "8.1" and "8.10" anyway because decimal precision would treat them the same with or without that zero.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Apr 2025 15:30:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Retain-Trailing-Zeros-in-Numeric-Variables/m-p/963719#M375404</guid>
      <dc:creator>djbateman</dc:creator>
      <dc:date>2025-04-08T15:30:54Z</dc:date>
    </item>
    <item>
      <title>Re: Retain Trailing Zeros in Numeric Variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Retain-Trailing-Zeros-in-Numeric-Variables/m-p/963720#M375405</link>
      <description>&lt;P&gt;If these are versions and not numbers, make them character, and then the problem is solved.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If these are numbers, SAS will always treat 8.1 and 8.10 as the same number.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Apr 2025 15:42:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Retain-Trailing-Zeros-in-Numeric-Variables/m-p/963720#M375405</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2025-04-08T15:42:01Z</dc:date>
    </item>
    <item>
      <title>Re: Retain Trailing Zeros in Numeric Variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Retain-Trailing-Zeros-in-Numeric-Variables/m-p/963722#M375407</link>
      <description>That's what I figured.  I'll let them know that the variable has to be character from the start.  Thanks for confirming!</description>
      <pubDate>Tue, 08 Apr 2025 15:34:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Retain-Trailing-Zeros-in-Numeric-Variables/m-p/963722#M375407</guid>
      <dc:creator>djbateman</dc:creator>
      <dc:date>2025-04-08T15:34:41Z</dc:date>
    </item>
    <item>
      <title>Re: Retain Trailing Zeros in Numeric Variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Retain-Trailing-Zeros-in-Numeric-Variables/m-p/963741#M375410</link>
      <description>&lt;P&gt;Another option might be to use &lt;EM&gt;leading&lt;/EM&gt; zeros for subversions &amp;lt;10, i.e., 8.01, 8.02, etc., and then to use a format such as &lt;FONT face="courier new,courier"&gt;6.2&lt;/FONT&gt; to display 8.1 as 8.10.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using a character variable is still the more robust solution, though. I have seen numeric non-integer values with a similar purpose in a clinical database which surprisingly were affected by tiny rounding errors (or numeric representation errors from the external database) so that testing exact equality (as in "&lt;FONT face="courier new,courier"&gt;if version=8.01 then&lt;/FONT&gt; ...") failed.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Apr 2025 18:24:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Retain-Trailing-Zeros-in-Numeric-Variables/m-p/963741#M375410</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2025-04-08T18:24:03Z</dc:date>
    </item>
  </channel>
</rss>

