BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
PhilipH
Quartz | Level 8

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.

1 ACCEPTED SOLUTION

Accepted Solutions
Astounding
PROC Star

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.

View solution in original post

3 REPLIES 3
Astounding
PROC Star

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.

PhilipH
Quartz | Level 8
hmhmmm that is interesting. thanks
Patrick
Opal | Level 21

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

 

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!

SAS Enterprise Guide vs. SAS Studio

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.

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
  • 3 replies
  • 5177 views
  • 2 likes
  • 3 in conversation