A CLI error occurs when you connect to DB2 with SAS/ACCESS® Interface to DB2 in a Windows operating environment


Under Windows, you might receive the following error message when you use SAS/ACCESS Interface to DB2 to connect to a DB2 database:

ERROR: CLI error trying to establish connection: [IBM][CLI Driver] SQL1031N The database directory
cannot be found on the indicated file system. SQLSTATE=58031 ERROR: Error in the LIBNAME statement.

The error occurs because the user does not have permission to the DB2 client settings.

To resolve this permission problem, administrators should make sure that users have both Read and Execute access to all DB2 objects through the operating system. Set these permissions as follows:

  1. Select Start ► Settings ► Control Panel ► Administrative Tools ► Computer Management.
  2. In the Computer Management window, select System Tools ► Local Users and Groups ► Groups.
  3. Right-click DB2USERS and select Properties from the menu.
  4. In the Properties dialog box, click Add.
  5. Enter the user ID. Then click Check Names.
  6. Click OK.
  7. Click Apply.

After making the above change, log off from the machine and log back in.