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
Calcite | Level 5

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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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