<?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: Import of long numbers in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Import-of-long-numbers/m-p/70540#M7061</link>
    <description>Yes, SOME 16 digit numbers will be represented correctly, but large numbers will fail. In windows, the following code&lt;BR /&gt;
&lt;BR /&gt;
data work.digit_test;&lt;BR /&gt;
a = 9234567812345670; put a 16.;&lt;BR /&gt;
a = 9234567812345671; put a 16.;&lt;BR /&gt;
a = 9234567812345672; put a 16.;&lt;BR /&gt;
a = 9234567812345673; put a 16.;&lt;BR /&gt;
a = 9234567812345674; put a 16.;&lt;BR /&gt;
a = 9234567812345675; put a 16.;&lt;BR /&gt;
a = 9234567812345676; put a 16.;&lt;BR /&gt;
a = 9234567812345677; put a 16.;&lt;BR /&gt;
a = 9234567812345678; put a 16.;&lt;BR /&gt;
a = 9234567812345679; put a 16.;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
produces this log.&lt;BR /&gt;
&lt;BR /&gt;
9234567812345670&lt;BR /&gt;
9234567812345672&lt;BR /&gt;
9234567812345672&lt;BR /&gt;
9234567812345672&lt;BR /&gt;
9234567812345674&lt;BR /&gt;
9234567812345676&lt;BR /&gt;
9234567812345676&lt;BR /&gt;
9234567812345676&lt;BR /&gt;
9234567812345678&lt;BR /&gt;
9234567812345680&lt;BR /&gt;
&lt;BR /&gt;
According to the SAS Unix notes, the code should fail in your environment as well. Give it a try, and post back what happens.&lt;BR /&gt;
&lt;BR /&gt;
Tom</description>
    <pubDate>Tue, 07 Jun 2011 01:13:45 GMT</pubDate>
    <dc:creator>TomKari</dc:creator>
    <dc:date>2011-06-07T01:13:45Z</dc:date>
    <item>
      <title>Import of long numbers</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Import-of-long-numbers/m-p/70533#M7054</link>
      <description>Hello!&lt;BR /&gt;
&lt;BR /&gt;
One of the variables in my source of data is number of 16 characters. &lt;BR /&gt;
I want this variable to have a numeric format in my dataset. &lt;BR /&gt;
When I import data into SAS, using EG import wizard,  I choose numeric format, but only 12 characters appear with trimming 4 last numbers.&lt;BR /&gt;
&lt;BR /&gt;
Can anybody explain how to import long numbers in SAS.</description>
      <pubDate>Fri, 27 May 2011 07:38:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Import-of-long-numbers/m-p/70533#M7054</guid>
      <dc:creator>V_Andy</dc:creator>
      <dc:date>2011-05-27T07:38:10Z</dc:date>
    </item>
    <item>
      <title>Re: Import of long numbers</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Import-of-long-numbers/m-p/70534#M7055</link>
      <description>Hello V. Andy,&lt;BR /&gt;
&lt;BR /&gt;
I tried to import text file contating long number with EG 4.3 import wizard. It was successful but I have to change Source Informat, Output Format and Output Format to BEST20.&lt;BR /&gt;
&lt;BR /&gt;
Sincerely,&lt;BR /&gt;
SPR</description>
      <pubDate>Fri, 27 May 2011 17:21:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Import-of-long-numbers/m-p/70534#M7055</guid>
      <dc:creator>SPR</dc:creator>
      <dc:date>2011-05-27T17:21:16Z</dc:date>
    </item>
    <item>
      <title>Re: Import of long numbers</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Import-of-long-numbers/m-p/70535#M7056</link>
      <description>Be careful with numbers with large numbers of digits; 15 significant digits is the most that will be accurately retained on most processors today. 16 digit and larger numbers risk losing accuracy.&lt;BR /&gt;
&lt;BR /&gt;
Tom</description>
      <pubDate>Sat, 28 May 2011 00:21:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Import-of-long-numbers/m-p/70535#M7056</guid>
      <dc:creator>TomKari</dc:creator>
      <dc:date>2011-05-28T00:21:29Z</dc:date>
    </item>
    <item>
      <title>Re: Import of long numbers</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Import-of-long-numbers/m-p/70536#M7057</link>
      <description>Hi &lt;BR /&gt;
&lt;BR /&gt;
If you don't need these digits for calculations then better store it in a character variable. Else you're going to have precision problems.&lt;BR /&gt;
&lt;BR /&gt;
HTH&lt;BR /&gt;
Patrick</description>
      <pubDate>Sat, 28 May 2011 05:14:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Import-of-long-numbers/m-p/70536#M7057</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2011-05-28T05:14:37Z</dc:date>
    </item>
    <item>
      <title>Re: Import of long numbers</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Import-of-long-numbers/m-p/70537#M7058</link>
      <description>Thanks to everybody for help!&lt;BR /&gt;
&lt;BR /&gt;
I just wanted to increcase the database productivity and decrease space occupied by dataset. I thought I could do it keeping my field in numeric format rather than in character.</description>
      <pubDate>Mon, 30 May 2011 08:16:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Import-of-long-numbers/m-p/70537#M7058</guid>
      <dc:creator>V_Andy</dc:creator>
      <dc:date>2011-05-30T08:16:37Z</dc:date>
    </item>
    <item>
      <title>Re: Import of long numbers</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Import-of-long-numbers/m-p/70538#M7059</link>
      <description>I'm with TomKari and Patrick on this one. If you have ever dealt with bank data, account numbers and credit card numbers are typically up to 16 digits long and so are always stored as character to avoid precision issues.</description>
      <pubDate>Mon, 30 May 2011 23:01:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Import-of-long-numbers/m-p/70538#M7059</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2011-05-30T23:01:02Z</dc:date>
    </item>
    <item>
      <title>Re: Import of long numbers</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Import-of-long-numbers/m-p/70539#M7060</link>
      <description>I find all releases of SAS can support 16digit numbers in numeric variables. Unfortunately, the default behaviour of excel is to convert the 16th (on th eright) to zero!&lt;BR /&gt;
Unsigned packed decimal (format/informat PK.) saves half the storage over strings.  &lt;BR /&gt;
have a look at the saslog after running this code, as tested on AIX&lt;BR /&gt;
data;&lt;BR /&gt;
input a : best20. ;&lt;BR /&gt;
file "&amp;amp;sysuserid/test.hex.data" ;&lt;BR /&gt;
put a pk8. ; &lt;BR /&gt;
list;cards;&lt;BR /&gt;
1234567812345678&lt;BR /&gt;
-3456 &lt;BR /&gt;
0&lt;BR /&gt;
88888888888888888&lt;BR /&gt;
;&lt;BR /&gt;
data ;&lt;BR /&gt;
infile "&amp;amp;sysuserid/test.hex.data" ;&lt;BR /&gt;
input @;&lt;BR /&gt;
list ;&lt;BR /&gt;
run;</description>
      <pubDate>Mon, 06 Jun 2011 14:56:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Import-of-long-numbers/m-p/70539#M7060</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2011-06-06T14:56:04Z</dc:date>
    </item>
    <item>
      <title>Re: Import of long numbers</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Import-of-long-numbers/m-p/70540#M7061</link>
      <description>Yes, SOME 16 digit numbers will be represented correctly, but large numbers will fail. In windows, the following code&lt;BR /&gt;
&lt;BR /&gt;
data work.digit_test;&lt;BR /&gt;
a = 9234567812345670; put a 16.;&lt;BR /&gt;
a = 9234567812345671; put a 16.;&lt;BR /&gt;
a = 9234567812345672; put a 16.;&lt;BR /&gt;
a = 9234567812345673; put a 16.;&lt;BR /&gt;
a = 9234567812345674; put a 16.;&lt;BR /&gt;
a = 9234567812345675; put a 16.;&lt;BR /&gt;
a = 9234567812345676; put a 16.;&lt;BR /&gt;
a = 9234567812345677; put a 16.;&lt;BR /&gt;
a = 9234567812345678; put a 16.;&lt;BR /&gt;
a = 9234567812345679; put a 16.;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
produces this log.&lt;BR /&gt;
&lt;BR /&gt;
9234567812345670&lt;BR /&gt;
9234567812345672&lt;BR /&gt;
9234567812345672&lt;BR /&gt;
9234567812345672&lt;BR /&gt;
9234567812345674&lt;BR /&gt;
9234567812345676&lt;BR /&gt;
9234567812345676&lt;BR /&gt;
9234567812345676&lt;BR /&gt;
9234567812345678&lt;BR /&gt;
9234567812345680&lt;BR /&gt;
&lt;BR /&gt;
According to the SAS Unix notes, the code should fail in your environment as well. Give it a try, and post back what happens.&lt;BR /&gt;
&lt;BR /&gt;
Tom</description>
      <pubDate>Tue, 07 Jun 2011 01:13:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Import-of-long-numbers/m-p/70540#M7061</guid>
      <dc:creator>TomKari</dc:creator>
      <dc:date>2011-06-07T01:13:45Z</dc:date>
    </item>
    <item>
      <title>Re: Import of long numbers</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Import-of-long-numbers/m-p/70541#M7062</link>
      <description>Tom is correct, of course. &lt;BR /&gt;
On windows and Unix not all 16 digit numbers can be presented accurately. The rule is about size. (and notice that in Tom's examples, even numbers seem OK)&lt;BR /&gt;
 &lt;BR /&gt;
The SAS Companions for SAS on Windows and Unix, show that the highest integer up to which integers are presented reliably, is 9,007,199,254,740,992.&lt;BR /&gt;
In "SAS 9.2 Companion for Windows, Second Edition", see &lt;A href="http://support.sas.com/documentation/cdl/en/hostwin/63285/HTML/default/numvar.htm#maxint" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/hostwin/63285/HTML/default/numvar.htm#maxint&lt;/A&gt;&lt;BR /&gt;
 &lt;BR /&gt;
On the zOS platform the limit is higher at 72,057,594,037,927,936&lt;BR /&gt;
So, on zOS platform there shouild be no problem holding and using a 16 digit number.&lt;BR /&gt;
  &lt;BR /&gt;
peterC

just to add that results from Toms data step are the same when run in unix (aix-64)     Message was edited by: Peter.C</description>
      <pubDate>Tue, 07 Jun 2011 11:56:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Import-of-long-numbers/m-p/70541#M7062</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2011-06-07T11:56:26Z</dc:date>
    </item>
  </channel>
</rss>

