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...
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.