<?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: program to check the maximum lengths used in the numeric variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/program-to-check-the-maximum-lengths-used-in-the-numeric/m-p/628737#M185842</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/240711"&gt;@noda6003&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;need to get the below from datasets&lt;/P&gt;
&lt;P&gt;float Num The largest allowable whole&lt;BR /&gt;number width plus the maximum&lt;BR /&gt;number of decimal digits.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The format of a SAS variable only influences how a value gets printed/written. It has no influence on how the value gets stored internally.&lt;/P&gt;
&lt;P&gt;The way you formulate your question makes me feel that you're eventually trying to do something that doesn't really make sense. Have a read of the&amp;nbsp;docu &lt;A href="https://go.documentation.sas.com/?docsetId=lrcon&amp;amp;docsetTarget=p0ji1unv6thm0dn1gp4t01a1u0g6.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_self"&gt;here&lt;/A&gt;&amp;nbsp;and if you then still feel that what you want to do makes sense then eventually reformulate your question and ask here again.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 02 Mar 2020 11:39:38 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2020-03-02T11:39:38Z</dc:date>
    <item>
      <title>program to check the maximum lengths used in the numeric variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/program-to-check-the-maximum-lengths-used-in-the-numeric/m-p/628711#M185823</link>
      <description>&lt;P&gt;is there any program where i can check the maximum length of float/integer variables including decimals.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;I found one link but it uses P21 metadata sheet. I just need to check the max length used in all datasets in a folder and get the significant digit.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help&lt;/P&gt;</description>
      <pubDate>Mon, 02 Mar 2020 10:10:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/program-to-check-the-maximum-lengths-used-in-the-numeric/m-p/628711#M185823</guid>
      <dc:creator>noda6003</dc:creator>
      <dc:date>2020-03-02T10:10:00Z</dc:date>
    </item>
    <item>
      <title>Re: program to check the maximum lengths used in the numeric variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/program-to-check-the-maximum-lengths-used-in-the-numeric/m-p/628712#M185824</link>
      <description>&lt;P&gt;The maximum number of decimal digits that SAS can work with reliably is between 15 and 16.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What you want to do is mathematically impossible, as a simple fraction like 1/3 already has an infinite number of decimal digits by definition.&lt;/P&gt;
&lt;P&gt;A very large integer wiil cause SAS to display in scientific notation (even with the best32. format, if the number is larger than 1E33), so the number of characters will not be what you want.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Mar 2020 10:18:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/program-to-check-the-maximum-lengths-used-in-the-numeric/m-p/628712#M185824</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-03-02T10:18:36Z</dc:date>
    </item>
    <item>
      <title>Re: program to check the maximum lengths used in the numeric variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/program-to-check-the-maximum-lengths-used-in-the-numeric/m-p/628727#M185834</link>
      <description>&lt;P&gt;I have specification which has all dataset names with format as float and length as 8 and what i want is to check the datasets maximum length of variable and if it is 5.1 then i want to overwrite my specification with significant value in this case as 5.1 instead of 8&lt;/P&gt;</description>
      <pubDate>Mon, 02 Mar 2020 11:01:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/program-to-check-the-maximum-lengths-used-in-the-numeric/m-p/628727#M185834</guid>
      <dc:creator>noda6003</dc:creator>
      <dc:date>2020-03-02T11:01:40Z</dc:date>
    </item>
    <item>
      <title>Re: program to check the maximum lengths used in the numeric variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/program-to-check-the-maximum-lengths-used-in-the-numeric/m-p/628730#M185837</link>
      <description>&lt;P&gt;&amp;nbsp;need to get the below from datasets&lt;/P&gt;
&lt;P&gt;float Num The largest allowable whole&lt;BR /&gt;number width plus the maximum&lt;BR /&gt;number of decimal digits.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Mar 2020 11:18:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/program-to-check-the-maximum-lengths-used-in-the-numeric/m-p/628730#M185837</guid>
      <dc:creator>noda6003</dc:creator>
      <dc:date>2020-03-02T11:18:28Z</dc:date>
    </item>
    <item>
      <title>Re: program to check the maximum lengths used in the numeric variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/program-to-check-the-maximum-lengths-used-in-the-numeric/m-p/628737#M185842</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/240711"&gt;@noda6003&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;need to get the below from datasets&lt;/P&gt;
&lt;P&gt;float Num The largest allowable whole&lt;BR /&gt;number width plus the maximum&lt;BR /&gt;number of decimal digits.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The format of a SAS variable only influences how a value gets printed/written. It has no influence on how the value gets stored internally.&lt;/P&gt;
&lt;P&gt;The way you formulate your question makes me feel that you're eventually trying to do something that doesn't really make sense. Have a read of the&amp;nbsp;docu &lt;A href="https://go.documentation.sas.com/?docsetId=lrcon&amp;amp;docsetTarget=p0ji1unv6thm0dn1gp4t01a1u0g6.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_self"&gt;here&lt;/A&gt;&amp;nbsp;and if you then still feel that what you want to do makes sense then eventually reformulate your question and ask here again.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Mar 2020 11:39:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/program-to-check-the-maximum-lengths-used-in-the-numeric/m-p/628737#M185842</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2020-03-02T11:39:38Z</dc:date>
    </item>
    <item>
      <title>Re: program to check the maximum lengths used in the numeric variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/program-to-check-the-maximum-lengths-used-in-the-numeric/m-p/628745#M185846</link>
      <description>&lt;P&gt;You confuse the length and the format.&lt;/P&gt;
&lt;P&gt;The length is the number of bytes used to store the number in binary floating encoding, the format determines how the stored value is displayed.&lt;/P&gt;
&lt;P&gt;I guess you want to determine the longest format(!) used in your datasets and then set this in all datasets. Is that correct?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Mar 2020 12:20:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/program-to-check-the-maximum-lengths-used-in-the-numeric/m-p/628745#M185846</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-03-02T12:20:45Z</dc:date>
    </item>
    <item>
      <title>Re: program to check the maximum lengths used in the numeric variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/program-to-check-the-maximum-lengths-used-in-the-numeric/m-p/628747#M185847</link>
      <description>&lt;P&gt;Sorry for confusing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to know The largest allowable whole number width plus the maximum number of decimal digits in each variable&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Mar 2020 12:33:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/program-to-check-the-maximum-lengths-used-in-the-numeric/m-p/628747#M185847</guid>
      <dc:creator>noda6003</dc:creator>
      <dc:date>2020-03-02T12:33:18Z</dc:date>
    </item>
    <item>
      <title>Re: program to check the maximum lengths used in the numeric variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/program-to-check-the-maximum-lengths-used-in-the-numeric/m-p/628766#M185857</link>
      <description>&lt;P&gt;The largest integer that can be represented with 8 bytes floating point is approximately 2 * 10 ** 308 (308 - 309 digits). See the wikipedia entry on floating point arithmetic. Only the 16 most significant digits would be represented accurately, of course.&lt;/P&gt;
&lt;P&gt;You can look for the maximal value in a given column, but the maximla number of digits is irrelevant (as already noted, 1/3 has an infinite numbef of decimal digits).&lt;/P&gt;
&lt;P&gt;In light of all this, make up your mind what you really want to achieve and restate your question. If possible, make up an example.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Mar 2020 14:03:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/program-to-check-the-maximum-lengths-used-in-the-numeric/m-p/628766#M185857</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-03-02T14:03:21Z</dc:date>
    </item>
    <item>
      <title>Re: program to check the maximum lengths used in the numeric variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/program-to-check-the-maximum-lengths-used-in-the-numeric/m-p/628834#M185878</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/240711"&gt;@noda6003&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have specification which has all dataset names with format as float and length as 8 and what i want is to check the datasets maximum length of variable and if it is 5.1 then i want to overwrite my specification with significant value in this case as 5.1 instead of 8&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The statement "dataset names with format as float and length as 8" typically doesn't make much sense in SAS as data set names can't start with digits. Do you mean variables within data sets or are you dealing with an external DBMS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also display formats, which are easy to find, do not affect the actual values stored. So more "digits" may be stored than the default format displays.&lt;/P&gt;
&lt;PRE&gt;data example;
   x=123.12345;
   format x f5.1;
run;
/* which will default to showing 123.1*/
proc print data=example;
run;
/* but more digits can be displayed when requested*/
proc print data=example;
   format x best12.;
run;&lt;/PRE&gt;
&lt;P&gt;Length, when referring to SAS numeric variables is the number of bytes used for storage and is limited to the integers 3 through 8. Please look in the SAS documentation for the limits of storage given a number of bytes.&lt;/P&gt;
&lt;P&gt;Large economy size hint: if the values contain any decimals you want to stay with 8.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Mar 2020 16:57:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/program-to-check-the-maximum-lengths-used-in-the-numeric/m-p/628834#M185878</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-03-02T16:57:13Z</dc:date>
    </item>
  </channel>
</rss>

