<?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: Length needed to store special missing numeric values in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Length-needed-to-store-special-missing-numeric-values/m-p/573403#M161880</link>
    <description>&lt;P&gt;I generally concur, but not completely. And I say this as a big fan of compression.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the PDV is predominantly numeric (especially with few missing values), or otherwise contains short fully populated character variables, compression can well &lt;EM&gt;increase&lt;/EM&gt; the size of the dataset. The extra I/Os required to read the larger-than-necessary dataset, with the extra cost of decompressing, can thus extend the run-time considerably.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My rule of thumb is: if compression is less than 30%, don't bother.&lt;/P&gt;</description>
    <pubDate>Sun, 14 Jul 2019 21:18:59 GMT</pubDate>
    <dc:creator>LaurieF</dc:creator>
    <dc:date>2019-07-14T21:18:59Z</dc:date>
    <item>
      <title>Length needed to store special missing numeric values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Length-needed-to-store-special-missing-numeric-values/m-p/572255#M161484</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does anyone know the length needed for a numeric value that is one of the special missing values, .A - .Z?&amp;nbsp; Integers between -8192 and 8192 can be stored in a numeric variable that is only length 3.&amp;nbsp; Special missing values appear to work fine with length = 3, too, but I want to get a definitive answer.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Warm regards,&lt;/P&gt;
&lt;P&gt;Michael&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 22:23:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Length-needed-to-store-special-missing-numeric-values/m-p/572255#M161484</guid>
      <dc:creator>Kastchei</dc:creator>
      <dc:date>2019-07-09T22:23:52Z</dc:date>
    </item>
    <item>
      <title>Re: Length needed to store special missing numeric values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Length-needed-to-store-special-missing-numeric-values/m-p/572257#M161486</link>
      <description>&lt;P&gt;3 is the minimum. Unless you're on an IBM mainframe, when I think it's 2!&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 22:34:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Length-needed-to-store-special-missing-numeric-values/m-p/572257#M161486</guid>
      <dc:creator>LaurieF</dc:creator>
      <dc:date>2019-07-09T22:34:39Z</dc:date>
    </item>
    <item>
      <title>Re: Length needed to store special missing numeric values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Length-needed-to-store-special-missing-numeric-values/m-p/572266#M161490</link>
      <description>&lt;P&gt;They work fine. Try it yourself.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
  length x3 3 x4 4 x5 5 x6 6 x7 7 x8 8;
  array x x3-x8;
  do y=.,.z,.a,._ ;
    do over x;
      x=y;
    end;
    output;
  end;
run;
data _null_;
  set test;
  put (_numeric_) (=);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;x3=. x4=. x5=. x6=. x7=. x8=. y=.
x3=Z x4=Z x5=Z x6=Z x7=Z x8=Z y=Z
x3=A x4=A x5=A x6=A x7=A x8=A y=A
x3=_ x4=_ x5=_ x6=_ x7=_ x8=_ y=_
NOTE: There were 4 observations read from the data set WORK.TEST.
&lt;/PRE&gt;</description>
      <pubDate>Wed, 10 Jul 2019 00:00:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Length-needed-to-store-special-missing-numeric-values/m-p/572266#M161490</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-07-10T00:00:29Z</dc:date>
    </item>
    <item>
      <title>Re: Length needed to store special missing numeric values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Length-needed-to-store-special-missing-numeric-values/m-p/572268#M161491</link>
      <description>&lt;P&gt;I think that&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16557"&gt;@Kastchei&lt;/a&gt;&amp;nbsp;knows that SAS can save the special missing values in 3 bytes. As I read it, he wants a formal answer on how many or how the data is stored.&lt;/P&gt;&lt;P&gt;I haven't seen any documentation about exactly how they are stored.&amp;nbsp;&lt;/P&gt;&lt;P&gt;SAS has documentation on how many bytes is needed to store an integer,&amp;nbsp;&lt;A href="https://documentation.sas.com/?docsetId=lrcon&amp;amp;docsetTarget=p0ji1unv6thm0dn1gp4t01a1u0g6.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en#p1ikmedbli0rz2n1de001ryz895o" target="_self"&gt;Maximum Integer Size&lt;/A&gt;, but that does not mention how they store special missing values. On the same page they mention the &lt;A href="https://documentation.sas.com/?docsetId=lrcon&amp;amp;docsetTarget=n1il1j711miuhrn1tp0pldybc6zq.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_self"&gt;special missing values&lt;/A&gt;, but they don't mention the storing of them there.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, I think there might not be an official answer. Instead we just have to hope that it works with 3 bytes and that they don't change anything in the future. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 01:15:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Length-needed-to-store-special-missing-numeric-values/m-p/572268#M161491</guid>
      <dc:creator>heffo</dc:creator>
      <dc:date>2019-07-10T01:15:46Z</dc:date>
    </item>
    <item>
      <title>Re: Length needed to store special missing numeric values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Length-needed-to-store-special-missing-numeric-values/m-p/572274#M161493</link>
      <description>In SAS, 3 bytes is the minimum length for a numeric variable, so the minimum length needed is 3 bytes. &lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://support.sas.com/documentation/cdl/en/hostwin/69955/HTML/default/viewer.htm#n04ccixfia6l2pn1f8szvttqg3hm.htm" target="_blank"&gt;https://support.sas.com/documentation/cdl/en/hostwin/69955/HTML/default/viewer.htm#n04ccixfia6l2pn1f8szvttqg3hm.htm&lt;/A&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 10 Jul 2019 01:32:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Length-needed-to-store-special-missing-numeric-values/m-p/572274#M161493</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-07-10T01:32:54Z</dc:date>
    </item>
    <item>
      <title>Re: Length needed to store special missing numeric values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Length-needed-to-store-special-missing-numeric-values/m-p/572276#M161494</link>
      <description>&lt;P&gt;I was asserting that it wasn't anything to worry about. From memory, they're stored in the length assigned, but only take up three bytes. Any length longer will just pad the extra with '00'x. That's in Windows - other operating systems will do it differently - big- and little-endian, and that sort of thing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS wouldn't dare change it, because all the code in the world would break!&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 01:37:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Length-needed-to-store-special-missing-numeric-values/m-p/572276#M161494</guid>
      <dc:creator>LaurieF</dc:creator>
      <dc:date>2019-07-10T01:37:32Z</dc:date>
    </item>
    <item>
      <title>Re: Length needed to store special missing numeric values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Length-needed-to-store-special-missing-numeric-values/m-p/572286#M161499</link>
      <description>&lt;P&gt;If your objective is to conserve disk space, I suspect you will get get better mileage by compressing your SAS data. Setting a SAS default of COMPRESS = YES or COMPRESS = BINARY in all SAS sessions is now quite a common practice. Then you don't need to worry about optimising variable lengths at all.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 02:49:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Length-needed-to-store-special-missing-numeric-values/m-p/572286#M161499</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2019-07-10T02:49:54Z</dc:date>
    </item>
    <item>
      <title>Re: Length needed to store special missing numeric values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Length-needed-to-store-special-missing-numeric-values/m-p/573290#M161828</link>
      <description>&lt;P&gt;Yeah, most of the time I don't worry about it and just use compression.&amp;nbsp; But changing the length is more saving than compression (sometimes both help), so on really big datasets, I try to use both.&lt;/P&gt;</description>
      <pubDate>Sat, 13 Jul 2019 13:32:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Length-needed-to-store-special-missing-numeric-values/m-p/573290#M161828</guid>
      <dc:creator>Kastchei</dc:creator>
      <dc:date>2019-07-13T13:32:38Z</dc:date>
    </item>
    <item>
      <title>Re: Length needed to store special missing numeric values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Length-needed-to-store-special-missing-numeric-values/m-p/573328#M161846</link>
      <description>&lt;P&gt;Good to hear you are using compression. My personal approach is that it is cheaper and quicker to not bother with changing numeric variable lengths as disk space is plentiful and nowadays relatively cheap.&lt;/P&gt;</description>
      <pubDate>Sat, 13 Jul 2019 22:49:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Length-needed-to-store-special-missing-numeric-values/m-p/573328#M161846</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2019-07-13T22:49:45Z</dc:date>
    </item>
    <item>
      <title>Re: Length needed to store special missing numeric values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Length-needed-to-store-special-missing-numeric-values/m-p/573330#M161848</link>
      <description>It's also slightly dangerous IMO because the last thing you'll check will be your DB settings but if your data changes for some reason and no longer fits into those space it doesn't always generate an error (depends on your systems) so you don't catch truncation issues or data issues until later on and it's a pain to debug these types of issues. Defensive programming would mean leaving some extra space there. My hours of time saved are worth more than a little extra disk space.</description>
      <pubDate>Sat, 13 Jul 2019 23:09:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Length-needed-to-store-special-missing-numeric-values/m-p/573330#M161848</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-07-13T23:09:36Z</dc:date>
    </item>
    <item>
      <title>Re: Length needed to store special missing numeric values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Length-needed-to-store-special-missing-numeric-values/m-p/573403#M161880</link>
      <description>&lt;P&gt;I generally concur, but not completely. And I say this as a big fan of compression.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the PDV is predominantly numeric (especially with few missing values), or otherwise contains short fully populated character variables, compression can well &lt;EM&gt;increase&lt;/EM&gt; the size of the dataset. The extra I/Os required to read the larger-than-necessary dataset, with the extra cost of decompressing, can thus extend the run-time considerably.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My rule of thumb is: if compression is less than 30%, don't bother.&lt;/P&gt;</description>
      <pubDate>Sun, 14 Jul 2019 21:18:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Length-needed-to-store-special-missing-numeric-values/m-p/573403#M161880</guid>
      <dc:creator>LaurieF</dc:creator>
      <dc:date>2019-07-14T21:18:59Z</dc:date>
    </item>
  </channel>
</rss>

