BookmarkSubscribeRSS Feed
jjjoy
Calcite | Level 5

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

7 REPLIES 7
kuridisanjeev
Quartz | Level 8

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

yaswanthj
Fluorite | Level 6

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

ArtC
Rhodochrosite | Level 12

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?

RobertH
Calcite | Level 5

We also have such large oracle numeric dimension keys.

Peter_C
Rhodochrosite | Level 12

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

     DBSASTYPE

might help

ArtC
Rhodochrosite | Level 12

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.

Peter_C
Rhodochrosite | Level 12

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

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 7 replies
  • 4868 views
  • 2 likes
  • 6 in conversation