SUPPORT / SAMPLES & SAS NOTES
 

Support

Usage Note 55490: DB2 data is not displayed correctly or is truncated when you use SAS/ACCESS® Interface to DB2

DetailsAboutRate It

When you use SAS/ACCESS Interface to DB2 to connect to DB2, you might encounter these issues:

  • The data and some special characters might not be displayed correctly.
  • Some special characters might be displayed as question marks.
  • You might receive this warning:
    WARNING: During read: [IBM][CLI Driver] CLI0002W Data truncated. SQLSTATE=01004.

The message appears because the DB2 encoding on the DB2 server does not match the DB2 encoding on the client.

To set the DB2 encoding correctly in SAS/ACCESS Interface to DB2, follow these steps:

  1. Run this query using the DB2 Command Line Processor to determine the value for the DB2CODEPAGE environment variable on the DB2 server:
    SELECT CODEPAGE FROM SYSCAT.DATATYPES WHERE TYPENAME='VARCHAR';
    Take note of the number that is returned and use it as the value for the DB2CODEPAGE environment variable in Step 2.
  2. Set DB2CODEPAGE by following the steps for your operating environment:
    • If SAS/ACCESS Interface to DB2 is installed on a Microsoft Windows system:
      1. Select Start ► Control Panel and click System. Then click Advanced system settings on the left.
      2. In the System Properties dialog box, click the Advanced tab.
      3. Click Environment Variables.
      4. In the System variables section, click New.
      5. In the Variable name field, enter DB2CODEPAGE.
      6. In the Variable value field, enter the value that was returned when you ran the query in Step 1.
    • If SAS/ACCESS Interface to DB2 is installed on a UNIX system:
      1. Open the sasenv_local file, located in !SASROOT/bin.
      2. Add this command to the file:
        export DB2CODEPAGE=DB2CODEPAGE-value
  3. Open a new SAS® session to verify that your data is displayed correctly.


Operating System and Release Information

Product FamilyProductSystemSAS Release
ReportedFixed*
SAS SystemSAS/ACCESS Interface to DB2Windows Vista9.3 TS1M0
Windows 7 Ultimate x649.3 TS1M0
Windows 7 Ultimate 32 bit9.3 TS1M0
Windows 7 Professional x649.3 TS1M0
Windows 7 Professional 32 bit9.3 TS1M0
Windows 7 Home Premium x649.3 TS1M0
Windows 7 Home Premium 32 bit9.3 TS1M0
Windows 7 Enterprise x649.3 TS1M0
Windows 7 Enterprise 32 bit9.3 TS1M0
Microsoft Windows XP Professional9.3 TS1M0
Microsoft Windows Server 2008 for x649.3 TS1M0
Microsoft Windows Server 2008 R29.3 TS1M0
Microsoft Windows Server 20089.3 TS1M0
Microsoft Windows Server 2003 for x649.3 TS1M0
Microsoft Windows Server 2003 Standard Edition9.3 TS1M0
Microsoft Windows Server 2003 Enterprise Edition9.3 TS1M0
Microsoft Windows Server 2003 Datacenter Edition9.3 TS1M0
Microsoft® Windows® for x649.3 TS1M0
Windows Vista for x649.3 TS1M0
64-bit Enabled AIX9.3 TS1M0
64-bit Enabled Solaris9.3 TS1M0
HP-UX IPF9.3 TS1M0
Linux9.3 TS1M0
Linux for x649.3 TS1M0
Solaris for x649.3 TS1M0
* For software releases that are not yet generally available, the Fixed Release is the software release in which the problem is planned to be fixed.