Capturing ODBC diagnostic trace information in the z/OS UNIX environment

Use the ODBC diagnostic trace only under the direction of IBM® Support. You can activate this diagnostic trace from the z/OS UNIX environment command line.

Procedure

To capture ODBC diagnostic trace information in the z/OS UNIX environment:

  1. Use the TSO/E command, OPUTX, to store the following program load modules in z/OS UNIX environment HFS files:
    • DSNAOTRC, for non-XPLINK applications
    • DSNAOTRX, for 31-bit XPLINK applications
    • DSNAO64T, for 64-bit applications
    The following example uses the OPUTX command to store load module DSNAOTRC from the partitioned data set prefix.SDSNLOAD to the HFS file DSNAOTRC in the directory /usr/db2:
    OPUTX  'prefix.SDSNLOAD(DSNAOTRC)'  /usr/db2/dsnaotrc
    The following example uses the OPUTX command to store load module DSNAOTRX from the partitioned data set prefix.SDSNLOD2 to the HFS file DSNAOTRX in the directory /usr/db2:
    OPUTX  'prefix.SDSNLOD2(DSNAOTRX)'  /usr/db2/dsnaotrx
    The following example uses the OPUTX command to store load module DSNAO64T from the partitioned data set prefix.SDSNLOD2 to the HFS file DSNAO64T in the directory /usr/db2:
    OPUTX  'prefix.SDSNLOD2(DSNAO64T)'  /usr/db2/dsnao64t
  2. Enable the shared address space environment variable for the z/OS UNIX shell. Issue the following export statement at the command line or specify it in your $HOME/.profile file:
    export _BPX_SHAREAS=YES
    Setting this environment variable allows the OMVS command and the z/OS UNIX shell to run in the same TSO address space.
  3. Go to the directory that contains the DSNAOTRC, DSNAOTRX, and DSNAO64T load modules.
  4. Verify that execute permission is established for the DSNAOTRC, DSNAOTRX, and DSNAO64T load modules. If execute permission was not granted, use the chmod command to set execute permission for each of the load modules.
  5. Issue one of the following ODBC diagnostic trace commands from the z/OS UNIX environment command line to activate the diagnostic trace:
    Option Description
    dsnaotrc on Use this command when tracing non-XPLINK applications.
    dsnaotrx on Use this command when tracing 31-bit XPLINK applications.
    dsnao64t on Use this command when tracing 64-bit XPLINK applications.
    The options for activating the diagnostic trace are optional.
  6. Run the ODBC application.
  7. Issue one of the following ODBC diagnostic trace commands from the z/OS UNIX environment command line to dump the diagnostic trace:
    Option Description
    dsnaotrc dmp "raw_trace_file" Use this command when tracing non-XPLINK applications.
    dsnaotrx dmp "raw_trace_file" Use this command when tracing 31-bit XPLINK applications.
    dsnao64t dmp "raw_trace_file" Use this command when tracing 64-bit XPLINK applications.
    The raw_trace_file value is the name of the output file to which Db2 writes the raw diagnostic trace data.
    Each of the following example statements show how to code the trace data set specification in the non-XPLINK environment. To code the following data set specifications in the XPLINK environment, replace the DSNAOTRC command with the DSNAOTRX or DSNAO64 command. All additional syntax for the trace command in each environment is identical.
    • Currently allocated JCL DD statement name TRACEDD
      DSNAOTRC DMP DD:TRACEDD
    • Sequential data set USER01.DIAGTRC
      DSNAOTRC DMP "USER01.DIAGTRC"
    • z/OS UNIX environment HFS file that is named DIAGTRC in directory /usr/db2
      DSNAOTRC DMP "/usr/db2/DIAGTRC"
  8. Issue one of the following ODBC diagnostic trace commands from the z/OS UNIX environment command line to deactivate the diagnostic trace:
    Option Description
    dsnaotrc off Use this command when tracing non-XPLINK applications.
    dsnaotrx off Use this command when tracing 31-bit XPLINK applications.
    dsnao64t off Use this command when tracing 64-bit XPLINK applications.
  9. Issue one of the following ODBC diagnostic trace commands from the z/OS UNIX environment command line to format the raw trace data records from input file raw_trace_file to output file fmt_trace_file.
    Option Description
    dsnaotrc fmt "raw_trace_file" "fmt_trace_file" Use this command when requesting detailed trace reports for non-XPLINK applications.
    dsnaotrc flw "raw_trace_file" "fmt_trace_file" Use this command when requesting flow trace reports for non-XPLINK applications.
    dsnaotrx fmt "raw_trace_file" "fmt_trace_file" Use this command when requesting detailed trace reports for 31-bit XPLINK applications.
    dsnaotrx flw "raw_trace_file" "fmt_trace_file" Use this command when requesting flow trace reports for 31-bit XPLINK applications.
    dsnao64t fmt "raw_trace_file" "fmt_trace_file" Use this command when requesting detailed trace reports for 64-bit XPLINK applications.
    dsnao64t flw "raw_trace_file" "fmt_trace_file" Use this command when requesting flow trace reports for 64-bit XPLINK applications.
    Each of the following statements show how to code the input data set specification in the non-XPLINK environment. To code the following data set specifications in the XPLINK environment, replace the DSNAOTRC command with the DSNAOTRX or DSNAO64 command. All additional syntax for the trace command in each environment is identical.
    • Currently allocated JCL DD statement name INPDD.
      DSNAOTRC FLW DD:INPDD output-dataset-spec
    • Sequential data set USER01.DIAGTRC.
      DSNAOTRC FLW "USER01.DIAGTRC" output-dataset-spec 
    • z/OS UNIX environment HFS file DIAGTRC in directory /usr/db2.
      DSNAOTRC FLW "/usr/db2/DIAGTRC" output-dataset-spec
    Each of the following example statements show how to code the output data set specification in the non-XPLINK environment. To code the following data set specifications in the XPLINK environment, replace the DSNAOTRC command with the DSNAOTRX or DSNAO64 command. All additional syntax for the trace command in each environment is identical.
    • Currently allocated JCL DD statement name OUTPDD.
      DSNAOTRC FLW input-dataset-spec DD:OUTPDD
    • Sequential data set USER01.TRCFLOW.
      DSNAOTRC FLW input-dataset-spec "USER01.TRCFLOW"
    • z/OS UNIX environment HFS file TRCFLOW in directory /usr/db2.
      DSNAOTRC FLW input-dataset-spec "/usr/db2/TRCFLOW"
  10. Delete the DSNAOTRC, DSNAOTRX, and DSNAO64T program modules from your z/OS UNIX environment directory. Do not attempt to maintain a private copy of the these program modules in your HFS directory.