You can debug your stored procedure and the calling application
with an ODBC application trace if both the application and stored
procedure are Db2 ODBC application
programs.
Procedure
To obtain an application trace for a client application
and a stored procedure:
- Set APPLTRACE=1 and APPLTRACEFILENAME="DD:DDNAME" in
the common section of the Db2 ODBC
initialization file as follows:
[COMMON]
APPLTRACE=1
APPLTRACEFILENAME="DD:APPLTRC"
DDNAME is
the name of the DD statement specified in both the JCL for the client
application job and the stored procedure address space.
- Specify a APPLTRC DD statement in the JCL for the client
application. The DD statement references a preallocated sequential
data set with DCB attributes RECFM=VBA,LRECL=137, or a z/OS® UNIX environment
HFS file to contain the client application trace, as shown in the
following examples:
//APPLTRC DD DISP=SHR,DSN=CLI.APPLTRC.CLIENT
//APPLTRC DD PATH='/u/cli/appltrc.client'
You
must allocate a separate application trace data set, or an HFS file
for the client application. Do not attempt to write to the same application
trace data set or HFS file used for the stored procedure.
- Specify a APPLTRC DD statement in the JCL for the stored
procedure address space. The DD statement references a preallocated
sequential data set, or a z/OS UNIX environment
HFS file to contain the stored procedure application trace, as shown
in the following examples:
//APPLTRC DD DISP=SHR,DSN=CLI.APPLTRC.SPROC
//APPLTRC DD PATH='/u/cli/appltrc.sproc'
You
must allocate a separate trace data set or HFS file for the stored
procedure. Do not attempt to write to the same application trace data
set or HFS file used for the client application.