Hello,
I got a numeric variable extracted from the Oracle DB that is set to numeric 8.
But the variable should be able to store 30 digits not just 18 or 19.
What would be the correct format that I need to apply?
I looked around for input and COMMA but that just created decimals.
Thanks for any help.
Using SAS, you will have to bring in the field as character. It's not a matter of finding a format (or an informat). It's that SAS cannot accurately store numbers that large. So even if you find a way to bring it in as numeric, SAS will change the value.
Using SAS, you will have to bring in the field as character. It's not a matter of finding a format (or an informat). It's that SAS cannot accurately store numbers that large. So even if you find a way to bring it in as numeric, SAS will change the value.
Unlike Oracle SAS has only two data types: Character and Numeric.
In SAS a length of 8 for a numeric variable doesn't mean 8 digits but that SAS uses 8 Bytes to store the value. This allows to store numbers with full precision up to 15 digits.
The only way to store more than 15 digits with full precision in SAS is to use a character variable - which is o.k. as long as you only use this data categorical and don't want to actually do calculations with it. Most of the time that's what such many digits are: Some ID or Account number or the like.
The conversion to character needs to happen on the database side - a cast() function with Oracle. If you use the table with these numeric(n) datatypes often then consider to create a view in Oracle and implement the cast() there; else use SQL pass-through or use option dbsastype http://support.sas.com/documentation/cdl/en/acreldb/69580/HTML/default/viewer.htm#n0v4ma1zb9lu99n172...
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.