how do i access db2 instance via telnet command prompt

Hi
I have a perl script code in which connecting with db2 database and doing some process. My perl script code and db2 database server present in the same unix server. I am connecting and executing perl script code via windows telnet. Now my question is i could not able to connect db2 server or invoke my db2 instance..If i give any db2 commands via telnet it's giving command not found. I wanted to invoke db2 instance via telnet through perl script.any help?

thanks in advance..

source the db2profile first. Either run from the command line or place at the top of the script.

. /home/$your_db2_instance_name/sqllib/db2profile

still i have a problem i couldn't able to connect db2. I gave the same which you have mentioned above but still i am getting command not found. I have checked manually i have a valid instance with database. I wanted to connect db2 via telnet command prompt.

$ /home/instance_name/sqllib/db2profile
ksh: /home/instance_name/sqllib/db2profile: not found.
$

any help really appreciated..

find /home -name db2profile 2> /dev/null

you need to replace instance_name with your DB2 instance.

ps -ef|grep db2sysc will show you the user(instance)