BookmarkSubscribeRSS Feed
SvenWagner
Fluorite | Level 6

Hi,

 

I'm running SAS 9.4 (M3) on a Windows 2016 Server. When accessing a DB2 Database (DB2 v11.1.4.5) on AIX 7.2 via SAS/ACCESS Interface to DB2, I get the following warning message:

 

WARNING: During read: [IBM][CLI Driver] CLI0182W Fractional truncation.SQLSTATE=01S07 : [IBM][CLI Driver] CLI0182W Fractional truncation.

(The message is repeated some more times. )

 

Occasionally, an additional error message occurs:

 

ERROR: An error occurred when translating from one type of character encoding to another.

 

I guess, the messages have something to do with encoding issues. While our database uses UTF-8, SAS uses WLATIN1. But changing the encoding within SAS is not an option. A "special feature": The same code sometimes results in warnings or error message, and sometimes it does not.

 

I found http://support.sas.com/kb/64/478.html, but this does not work within our environment.

 

Has anybody an idea how to solve this issue?

4 REPLIES 4
s_lassen
Meteorite | Level 14

As far as I can fathom, the "fractional truncation" message comes when you try to store a decimal (or perhaps a floating point?) value in an integer column. But I am not sure how that would come about if you are only reading from the DB2 database.

 

Could you show the query that generates the message?

 

The encoding problem cannot be solved, unless you store your SAS data in a format that accepts all the possible values for character variables, there are many characters in UTF-8 that are not represented in a simple 8-bit character format such as WLATIN1. Even if you are not allowed to change the encoding for the SAS session, you can still use the ENCODING= dataset option on the table that you extract from DB2.

ChrisNZ
Tourmaline | Level 20

The truncation message could be due to numeric precision issues. If the DB2 mantissa in longer than 15 digits, you must drop some of them when using Windows.

The character set issue only seems solvable by using the  encoding=  data set option in your case. Of course, you will not be able to visualise the data set's contents if the SAS session uses the wrong encoding.

SvenWagner
Fluorite | Level 6

Hi,

 

the query is a quite simple DATA STEP as you can see in the attachment.

 

Btw.: There is some more / other database return in the log than I would expect, or I'm used to. Do you have any clue what this means?

 

Best, Sven

ChrisNZ
Tourmaline | Level 20

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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.

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
  • 4 replies
  • 1043 views
  • 1 like
  • 3 in conversation