Use the job trace tool to trace data in any job to help identify your problem.
Job trace is a problem analysis tool that allows you to look at what any application is doing. Use job trace as a first step in locating a problem with an application. You can turn on job trace in any job and see the call and return flows of that application. Job trace records the raw data and then stores it in a set of database files.
The job trace is performed using a series of CL commands, such as STRTRC (Start Trace), ENDTRC (End Trace), and PRTTRC (Print Trace). Starting a job trace consumes relatively few system resources. However, ending the job trace and printing the job trace require more time and processing resources. If you have a limited amount of interactive capability available on your system, you might want to submit the ENDTRC and PRTTRC to batch.
Note that if the application code is created with OPTIMIZE(40), the optimization disables call and instruction tracing. Although you can specify LICOPT (CallTracingAtHighOpt) to enable job call tracing, the optimization might still disable some calls. Therefore, job trace might not be effective when using OPTIMIZE(40).
Use job trace in these situations:
To use the CL commands to perform a job trace, you must have *SERVICE special authority, or be authorized to the service trace function of i5/OS through iSeries™ Navigator. See the chapter on user profiles in iSeries Security Reference for more information about this type of authority.
Use the following job trace instructions as a guide. The example demonstrates how to use job trace to troubleshoot a sockets application. Sockets adds information to the job trace output when errors are returned on the sockets APIs. You might need to specify different parameters, depending on the type of application you are troubleshooting. Note that communications trace is also useful when troubleshooting sockets applications.