When you use SAS/ACCESS Interface to DB2 to connect to DB2, you might encounter these issues:
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:
- 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. - Set DB2CODEPAGE by following the steps for your operating environment:
- If SAS/ACCESS Interface to DB2 is installed on a Microsoft Windows system:
- Select Start ► Control Panel and click System. Then click Advanced system settings on the left.
- In the System Properties dialog box, click the Advanced tab.
- Click Environment Variables.
- In the System variables section, click New.
- In the Variable name field, enter DB2CODEPAGE.
- 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:
- Open the sasenv_local file, located in !SASROOT/bin.
- Add this command to the file:
export DB2CODEPAGE=DB2CODEPAGE-value
- Open a new SAS® session to verify that your data is displayed correctly.