CTF Trace

Provides PL/I-specific information about using the Consolidated Tracing Facility (CTF Trace) to identify where an application has failed.

You can use CTF Trace to troubleshoot PL/I code compiled with the -ctf compiler option.

CTF Trace is documented in detail in the Consolidated Tracing Facility topics and subtopics. In this section, we provide additional details specific to using CTF Trace to diagnose problems with PL/I applications.

Creating a ctf.cfg file for your PL/I application

The CTF Trace accesses the ctf.cfg file for information about trace output. To ensure that this configuration file contains all that is required to perform a trace on your PL/I application, edit the ctf.cfg file before running the facility. We have provided a sample CTF configuration file that you can use to get started. See Example CTF Configuration File for details.

Generating a CTF trace of application logic without modifying code.

You can automatically generate a CTF trace for entry into a PL/I procedure and exit from the procedure. The 6 event in a PL/I trace shows the line number at which the PL/I procedure was entered, and the 7 event shows the line number where the PL/I procedure was exited.

To automatically generate 6/7 events, compile using the -ctf directive indicating the level of reporting and the type of trace (#syspgm or #pgm) using two parameters. For example:

-ctf 1,16

Where:

  • 1 indicates a trace reporting info messages
  • 16 indicates #pgm tracing

For complete information about using the -ctf compiler option, see Compiler Options.

Troubleshooting CTF

The most common issue with CTF is that a trace file is not actually produced. Use the following list to check that each statement is true. If not, correct the issue and try again.

  • mftrace.application is either not set or is set to the proper application name
  • mftrace.emitter.textfile#location is set to a fully qualified, writable location (check permissions) that can be accessed by the user ID running the enterprise server region
  • All end-of-line (EOL) markers are correct.
    Important: When transferring a CTF trace file from Windows to Linux/UNIX, be sure to transfer it as ASCII so that the EOL markers are converted properly. You can also use the dos2unix utility to make the conversion after transferring the file.