Create your own TPN for debugging a DB2 Universal Databaseā„¢ for iSeriesā„¢ application server job

You can create your own TPN by compiling a CL program that contains debug statements and a TFRCTL QSYS/QCNTEDDM statement at the end. The advantage of this is that you do not need any manual intervention when making the connection.

See the following code for an example program:

Note: By using the code examples, you agree to the terms of the Code license and disclaimer information.
PGM
   MONMSG CPF0000
      STRDBG UPDPROD(*YES)  PGM(CALL/QRWTEXEC) MAXTRC(9999)
      ADDBKP STMT(CKUPDATE) PGMVAR((*CHAR (SQLDA@))) OUTFMT(*HEX) +
              LEN(1400)
      ADDTRC PGMVAR((DSLENGTH ()) (LNTH ()) (FDODTA_LNTH ()))
      TRCJOB *ON TRCTYPE(*DATA) MAXSTG(2048) TRCFULL(*STOPTRC)
      TFRCTL QSYS/QCNTEDDM  
ENDPGM  

The TPN name in the RDB directory entry of the application requester (AR) is the name that you supply. Use the text field to provide a warning that the special TPN is in use, and be sure to change the TPN name back when you have done debugging.

Be aware that when you change the TPN of an RDB, all connections from that AR will use the new TPN until you change it back. This might cause surprises for unsuspecting users, such as poor performance, long waits for operator responses, and the filling up of storage with debug data.