Troubleshooting
Problem
When attempting to run any commands in the Windows command line, as in the following example, an error message is displayed: DB21061E Command line environment not initialized
Symptom
The user is unable to connect to the DB2 database.
Cause
The environment variable DB2CLP is not set correctly
Diagnosing The Problem
As an example: attempt to connect to the database:
C:\programdata\IBM\DB2\DB2TSM1\SERVER1>db2 connect to MYDB
This will fail with "DB21061E Command line environment not initialized"
Resolving The Problem
Run the following command to set the DB2 command line (DB2CLP) variable:
db2cmd -i -w db2clpsetcp
Check that the DB2CLP variable has been set correctly:
echo %DB2CLP%
This should now show:
DB20FADE
Once this is done, the db2 connect command should work properly
Related Information
Was this topic helpful?
Document Information
Modified date:
16 June 2018
UID
swg21698016