BookmarkSubscribeRSS Feed
tommy81
Obsidian | Level 7
Hi ,

While reading a table from Oracle which has a column containing an Oracle Integer value of 17 digits from sas and converting to a dataset , is displayed in SAS as Exponentinal no.

ex REGNO(ORACLE) 12345678912345445

VAR(SAS)
1.26E16

However if I convert it again into numeric using Input function while reading , the value would be rounded 12345678912345450 .

Please could someone suggest an alternative to display the full digits .

Message was edited by: tommy81

Message was edited by: tommy81 Message was edited by: tommy81
3 REPLIES 3
Ksharp
Super User
Unfortunately,I guess your SAS only has exact int about 16 digit.You can test it by yourself
with the following my code,that mean you can not use it to mathematical ,But you can
display it by transforming it into character type or make length longer.(only suited for 17 digit)
p.s 8 is the max bytes for numeric data in my computer. So only can exact to 16 digit.


[pre]
data _null_;
exactint=constant('exactint',8);
put 'exactint=' exactint ;
length test 8;
input test best20.;
put 'test=' test best20.;
char_test=put(test,best20.);
put 'char_test=' char_test;
stop;
cards;
12345678912345678
;
run;

[/pre]


Ksharp
FriedEgg
SAS Employee
You could convert the oracle integer to character during pull.

proc sql;
connect to oracle(user=blah orapw=blah path=blah connection=global);

create table blah as select * from connection to oracle
( select to_char(integer,9999999999999999) as char from table );

disconnect fro oracle;
quit;
ChrisNZ
Tourmaline | Level 20

It is all explained here:

http://support.sas.com/documentation/cdl/en/lrcon/62955/HTML/default/viewer.htm#a000695157.htm

and

http://www.sascommunity.org/wiki/Numeric_representation_issues_in_SAS

The larger integer sas can accurately represent with 8 bytes is 9,007,199,254,740,990 under Windows and 72,057,594,037,927,900 on mainframes.

Your number 12,345,678,912,345,445 is too large for the Windows platform.

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 3 replies
  • 2576 views
  • 0 likes
  • 4 in conversation