Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2012

    Unanswered: set DB2CLP=**$$** : Unix style CLP (Command Line Processor) under DB2 for Windows

    For all those out there struggeling with the annoying (and actually NOT needed) DB2CMD.EXE

    HowTo have a Unix style CLP (Command Line Processor) under DB2 for Windows , the Magic Trick :

    • set DB2INSTANCE=some-valid-instance
    • set DB2CLP=**$$**

    It's been around for some time, but badly documented ...., it works with DB2 9.5.5 and DB2 ver 9.7.5

    One does NOT need the annoying DB2CMD.EXE (annoying, because it opens an new command window / leftover cmd.exe process when used in scripting / scheduled task(s) etc. )

    Can this also be done in PowerShell ? of course it can.
    Set environment variable DB2CLP to string **$$** and you can use PowerShell for DB2 commands :

    PS> set-item -path env:DB2CLP -value "**$$**"
    PS> db2 connect to mydb
    TIP: set it once as Windows System Environment Variable
    One way would be to set it once in

    <My Computer> (right mouse click to get <Properties>, click on
    <Advanced> tab, then click on <Environment Variables> (bottom button).

    Under <System Variables> click <New> and fill form with:

    Variable name DB2CLP
    Variable value **$$**

    Attached is "DB2 LUW Windows - Unix style Command Line Environment (CLP).jpg" , an example of its usage making things more clear, I hope ...
    Attached Thumbnails Attached Thumbnails DB2 LUW Windows - Unix style Command Line Environment (CLP).jpg  

  2. #2
    Join Date
    Mar 2006
    Bogota, Colombia

    Why **$$**?

    What does **$$** mean?

    Why do I have to set the env variable DB2CLP to that value and not to DB20FADE as it appears when issuing db2cmd.exe?

    I have played with this variable, and if I set DB2CLP to other values (*, **, ..) it still works.

  3. #3
    Join Date
    Jan 2009
    Zoetermeer, Holland
    Yep, nice trick/feature. Works in your cygwin/mobaXterm shell as well.
    When the connection will not stick on those shells, it is time for another better not use option: DB2DBDFT. An ugly trick to bypass that problem
    Somewhere between " too small" and " too large" lies the size that is just right.
    - Scott Hayes

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts