Help using Base SAS procedures

how to reading in num value with more than 16 digits!

Reply
Learner
Posts: 1

how to reading in num value with more than 16 digits!

I have a variable in ORACLE database with value like 12345678901234567890--20 digits.

But SAS only support up to 16 digits.

Is there anyway to read in that 20 digits number without loss of accuracy?

Thank you

Super Contributor
Posts: 276

Re: how to reading in num value with more than 16 digits!

By using Formats   you can able to display numeric variables which length is more then 16.

Ex..

data dsn;

a=12345678910122341258;

format a best20.;

run;

proc print;

run;

Regards..

Sanjeev.K

Contributor
Posts: 70

Re: how to reading in num value with more than 16 digits!

I think it is not possible as Numeric............Smiley Happy If you derive as character just use length. 

Valued Guide
Posts: 632

Re: how to reading in num value with more than 16 digits!

It is not a matter of importing the value, but rather one of storage.  SAS uses a length of 8 to store numerics, this allows 16 digits to be stored accurately (depending on your OS).  See http://support.sas.com/techsup/technote/ts654.pdf for more information.

So what to do?  It depends.  What do you want to do with the data value?  Arithmatic?  Is it a code that can be converted to character as suggested above?

New Contributor
Posts: 2

Re: how to reading in num value with more than 16 digits!

We also have such large oracle numeric dimension keys.

Valued Guide
Posts: 2,174

Re: how to reading in num value with more than 16 digits!

try to enforce conversion to character to store in SAS. The option

     DBSASTYPE

might help

Valued Guide
Posts: 632

Re: how to reading in num value with more than 16 digits!

If these are just key values can't they be treated as character strings?  If you truly need them to be numeric, you will need to tell us what it is that you are trying to accomplish with them.

Valued Guide
Posts: 2,174

Re: how to reading in num value with more than 16 digits!

does the table server help, with its extension to data types in SAS.

It was called something like "data step 2" before GA in earlier releases of SAS9

Ask a Question
Discussion stats
  • 7 replies
  • 333 views
  • 2 likes
  • 6 in conversation