<?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: HOW TO STORE A NUMERIC VALUE IN SAS WITH 22 DIGITS INCLUDES DECIMAL in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/HOW-TO-STORE-A-NUMERIC-VALUE-IN-SAS-WITH-22-DIGITS-INCLUDES/m-p/820535#M323874</link>
    <description>&lt;P&gt;What exactly does that "number" represent with that many digits where a decimal is important?&lt;/P&gt;</description>
    <pubDate>Mon, 27 Jun 2022 14:59:16 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2022-06-27T14:59:16Z</dc:date>
    <item>
      <title>HOW TO STORE A NUMERIC VALUE IN SAS WITH 22 DIGITS INCLUDES DECIMAL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/HOW-TO-STORE-A-NUMERIC-VALUE-IN-SAS-WITH-22-DIGITS-INCLUDES/m-p/820491#M323850</link>
      <description>&lt;P&gt;I wanted to create table numeric which can store 22 digits and with decimals.&lt;/P&gt;&lt;P&gt;I need to create a table in proc sql only&lt;/P&gt;&lt;P&gt;and run insert query to enter the data.&lt;/P&gt;&lt;P&gt;Eg=123456789987654321.999&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this is the numeric value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jun 2022 10:07:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/HOW-TO-STORE-A-NUMERIC-VALUE-IN-SAS-WITH-22-DIGITS-INCLUDES/m-p/820491#M323850</guid>
      <dc:creator>ANIRBAN2</dc:creator>
      <dc:date>2022-06-27T10:07:42Z</dc:date>
    </item>
    <item>
      <title>Re: HOW TO STORE A NUMERIC VALUE IN SAS WITH 22 DIGITS INCLUDES DECIMAL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/HOW-TO-STORE-A-NUMERIC-VALUE-IN-SAS-WITH-22-DIGITS-INCLUDES/m-p/820492#M323851</link>
      <description>NO. You can't .&lt;BR /&gt;But you could try PROC FEDSQL ,there is a BIGINT type variable.</description>
      <pubDate>Mon, 27 Jun 2022 10:14:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/HOW-TO-STORE-A-NUMERIC-VALUE-IN-SAS-WITH-22-DIGITS-INCLUDES/m-p/820492#M323851</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2022-06-27T10:14:26Z</dc:date>
    </item>
    <item>
      <title>Re: HOW TO STORE A NUMERIC VALUE IN SAS WITH 22 DIGITS INCLUDES DECIMAL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/HOW-TO-STORE-A-NUMERIC-VALUE-IN-SAS-WITH-22-DIGITS-INCLUDES/m-p/820498#M323854</link>
      <description>&lt;P&gt;You can store the number, but only with precision down to the 15th digit (overall). The imprecision is statistically insignificant.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jun 2022 11:13:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/HOW-TO-STORE-A-NUMERIC-VALUE-IN-SAS-WITH-22-DIGITS-INCLUDES/m-p/820498#M323854</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-06-27T11:13:50Z</dc:date>
    </item>
    <item>
      <title>Re: HOW TO STORE A NUMERIC VALUE IN SAS WITH 22 DIGITS INCLUDES DECIMAL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/HOW-TO-STORE-A-NUMERIC-VALUE-IN-SAS-WITH-22-DIGITS-INCLUDES/m-p/820535#M323874</link>
      <description>&lt;P&gt;What exactly does that "number" represent with that many digits where a decimal is important?&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jun 2022 14:59:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/HOW-TO-STORE-A-NUMERIC-VALUE-IN-SAS-WITH-22-DIGITS-INCLUDES/m-p/820535#M323874</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-06-27T14:59:16Z</dc:date>
    </item>
    <item>
      <title>Re: HOW TO STORE A NUMERIC VALUE IN SAS WITH 22 DIGITS INCLUDES DECIMAL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/HOW-TO-STORE-A-NUMERIC-VALUE-IN-SAS-WITH-22-DIGITS-INCLUDES/m-p/820538#M323876</link>
      <description>&lt;P&gt;You could try and use &lt;A title="Using Explicit Pass-Through" href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/fedsqlref/p1t7brk6e1lguwn1j4icn4s058h6.htm" target="_self"&gt;explicit SQL pass-through&lt;/A&gt;. That way you use the SQL of the target DBMS. But that would only work if the large number is hardcoded in plain text or coming from another dbms table. It could not come from a SAS dataset. SAS' 8-byte numeric is either large magnitude or high precision but not both. Compare that to the 17-byte decimal in SQL Server. Can't fit round pins in square holes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;FedSQL may also be viable here but I have little experience go offer there.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;- Jan.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jun 2022 15:20:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/HOW-TO-STORE-A-NUMERIC-VALUE-IN-SAS-WITH-22-DIGITS-INCLUDES/m-p/820538#M323876</guid>
      <dc:creator>jklaverstijn</dc:creator>
      <dc:date>2022-06-27T15:20:05Z</dc:date>
    </item>
    <item>
      <title>Re: HOW TO STORE A NUMERIC VALUE IN SAS WITH 22 DIGITS INCLUDES DECIMAL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/HOW-TO-STORE-A-NUMERIC-VALUE-IN-SAS-WITH-22-DIGITS-INCLUDES/m-p/820541#M323878</link>
      <description>&lt;P&gt;You cannot store that many digits of precision as a single number in a SAS dataset.&amp;nbsp; SAS has two variable types, fixed length character strings and 64 bit floating point numbers.&amp;nbsp; The maximum number of decimal digits you can store without lose of precision is 15.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you just store the value as a string of 22 (or perhaps 23 with the period?) characters?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;string='123456789987654321.999';&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Is the maximum absolute value just 10E18 like in your example and you only need three digits to the right of the decimal point?&amp;nbsp; Then you could store the first 11 to 15 digits in one number and the rest in another number.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example split the value into X and Y such that X+Y gets the desired value (if done in an environment that supports such precision).&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;x=123456789987000000.000;
y=000000000000654321.999;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 27 Jun 2022 15:38:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/HOW-TO-STORE-A-NUMERIC-VALUE-IN-SAS-WITH-22-DIGITS-INCLUDES/m-p/820541#M323878</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-06-27T15:38:22Z</dc:date>
    </item>
    <item>
      <title>Re: HOW TO STORE A NUMERIC VALUE IN SAS WITH 22 DIGITS INCLUDES DECIMAL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/HOW-TO-STORE-A-NUMERIC-VALUE-IN-SAS-WITH-22-DIGITS-INCLUDES/m-p/820543#M323879</link>
      <description>I have the data in a excel I will write a insert query to upload the data into SAS datasets&lt;BR /&gt;So this method how will it work??&lt;BR /&gt;Already defined the table its variable name and datatype struggling when using insert query to upload the data. That time I wanted to change the length of the numerical variable so that i could fit the value with precision but I failed.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 27 Jun 2022 15:47:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/HOW-TO-STORE-A-NUMERIC-VALUE-IN-SAS-WITH-22-DIGITS-INCLUDES/m-p/820543#M323879</guid>
      <dc:creator>ANIRBAN2</dc:creator>
      <dc:date>2022-06-27T15:47:29Z</dc:date>
    </item>
    <item>
      <title>Re: HOW TO STORE A NUMERIC VALUE IN SAS WITH 22 DIGITS INCLUDES DECIMAL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/HOW-TO-STORE-A-NUMERIC-VALUE-IN-SAS-WITH-22-DIGITS-INCLUDES/m-p/820544#M323880</link>
      <description>That number is used at some where to calculate the VAR at retail banking. That I am not actually aware totally.</description>
      <pubDate>Mon, 27 Jun 2022 15:49:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/HOW-TO-STORE-A-NUMERIC-VALUE-IN-SAS-WITH-22-DIGITS-INCLUDES/m-p/820544#M323880</guid>
      <dc:creator>ANIRBAN2</dc:creator>
      <dc:date>2022-06-27T15:49:59Z</dc:date>
    </item>
    <item>
      <title>Re: HOW TO STORE A NUMERIC VALUE IN SAS WITH 22 DIGITS INCLUDES DECIMAL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/HOW-TO-STORE-A-NUMERIC-VALUE-IN-SAS-WITH-22-DIGITS-INCLUDES/m-p/820550#M323884</link>
      <description>Ah you want it in SAS. Sorry my brain was talking database to me. &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;</description>
      <pubDate>Mon, 27 Jun 2022 16:09:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/HOW-TO-STORE-A-NUMERIC-VALUE-IN-SAS-WITH-22-DIGITS-INCLUDES/m-p/820550#M323884</guid>
      <dc:creator>jklaverstijn</dc:creator>
      <dc:date>2022-06-27T16:09:30Z</dc:date>
    </item>
    <item>
      <title>Re: HOW TO STORE A NUMERIC VALUE IN SAS WITH 22 DIGITS INCLUDES DECIMAL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/HOW-TO-STORE-A-NUMERIC-VALUE-IN-SAS-WITH-22-DIGITS-INCLUDES/m-p/820595#M323911</link>
      <description>&lt;P&gt;Are you referring to retail banking &lt;A href="https://www.investopedia.com/terms/v/var.asp" target="_blank" rel="noopener"&gt;Value at Risk&lt;/A&gt; (VaR) ? If so there is no way you need 22 digits of precision for this. At the very least this would be calculated as a whole number (no decimals) and 10 digits can accurately store up to $9,999,999,999. Please post the SAS log of your program so we can advise further.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jun 2022 20:47:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/HOW-TO-STORE-A-NUMERIC-VALUE-IN-SAS-WITH-22-DIGITS-INCLUDES/m-p/820595#M323911</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2022-06-27T20:47:28Z</dc:date>
    </item>
    <item>
      <title>Re: HOW TO STORE A NUMERIC VALUE IN SAS WITH 22 DIGITS INCLUDES DECIMAL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/HOW-TO-STORE-A-NUMERIC-VALUE-IN-SAS-WITH-22-DIGITS-INCLUDES/m-p/820627#M323926</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ANIRBAN2_0-1656387004499.png" style="width: 723px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/72772i6B251DF91FD985F2/image-dimensions/723x84?v=v2" width="723" height="84" role="button" title="ANIRBAN2_0-1656387004499.png" alt="ANIRBAN2_0-1656387004499.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I just hope you can see as template provided by the company(Integrated)&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2022 03:30:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/HOW-TO-STORE-A-NUMERIC-VALUE-IN-SAS-WITH-22-DIGITS-INCLUDES/m-p/820627#M323926</guid>
      <dc:creator>ANIRBAN2</dc:creator>
      <dc:date>2022-06-28T03:30:59Z</dc:date>
    </item>
    <item>
      <title>Re: HOW TO STORE A NUMERIC VALUE IN SAS WITH 22 DIGITS INCLUDES DECIMAL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/HOW-TO-STORE-A-NUMERIC-VALUE-IN-SAS-WITH-22-DIGITS-INCLUDES/m-p/820628#M323927</link>
      <description>I am in position of inputting sample data. Logs I cannot provide. Please view the snip.</description>
      <pubDate>Tue, 28 Jun 2022 03:32:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/HOW-TO-STORE-A-NUMERIC-VALUE-IN-SAS-WITH-22-DIGITS-INCLUDES/m-p/820628#M323927</guid>
      <dc:creator>ANIRBAN2</dc:creator>
      <dc:date>2022-06-28T03:32:49Z</dc:date>
    </item>
    <item>
      <title>Re: HOW TO STORE A NUMERIC VALUE IN SAS WITH 22 DIGITS INCLUDES DECIMAL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/HOW-TO-STORE-A-NUMERIC-VALUE-IN-SAS-WITH-22-DIGITS-INCLUDES/m-p/820632#M323931</link>
      <description>&lt;P&gt;That screenshot shows no numbers more than 10 digits long. As others have said, SAS numeric variables can accurately hold 15 digits so I don't see what your problem is. You need to provide a log of your SAS program if it is producing errors and you want help with that.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2022 03:41:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/HOW-TO-STORE-A-NUMERIC-VALUE-IN-SAS-WITH-22-DIGITS-INCLUDES/m-p/820632#M323931</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2022-06-28T03:41:57Z</dc:date>
    </item>
    <item>
      <title>Re: HOW TO STORE A NUMERIC VALUE IN SAS WITH 22 DIGITS INCLUDES DECIMAL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/HOW-TO-STORE-A-NUMERIC-VALUE-IN-SAS-WITH-22-DIGITS-INCLUDES/m-p/820633#M323932</link>
      <description>&lt;P&gt;Surely you can run your program with fake data to produce the same errors? There shouldn't be anything confidential about that.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2022 03:53:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/HOW-TO-STORE-A-NUMERIC-VALUE-IN-SAS-WITH-22-DIGITS-INCLUDES/m-p/820633#M323932</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2022-06-28T03:53:33Z</dc:date>
    </item>
    <item>
      <title>Re: HOW TO STORE A NUMERIC VALUE IN SAS WITH 22 DIGITS INCLUDES DECIMAL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/HOW-TO-STORE-A-NUMERIC-VALUE-IN-SAS-WITH-22-DIGITS-INCLUDES/m-p/820637#M323936</link>
      <description>&lt;P&gt;Excel has the same precision limits as SAS, as it uses the same 8 byte floating point storage. So you can't precisely store a number with 22 digits in both environments.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2022 05:03:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/HOW-TO-STORE-A-NUMERIC-VALUE-IN-SAS-WITH-22-DIGITS-INCLUDES/m-p/820637#M323936</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-06-28T05:03:38Z</dc:date>
    </item>
  </channel>
</rss>

