SAS Programming

DATA Step, Macro, Functions and more
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

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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