IBM Support

Generate job logs for all connections to Db2 for IBM i

How To


Summary

By default, an end code severity less than 20 in Database server jobs (QZDASOINIT/QZDASSINIT or QRWTSRVR) does not cause a job log to be generated.
This document explains how to cause a job log to always be generated, regardless of job end code severity.

Environment

⚠️ IMPORTANT: Temporary Debugging Configuration Only

This procedure enables job log generation for EVERY QZDASOINIT connection to help diagnose specific database host server issues.

  • Should ONLY be used during active troubleshooting
  • Will generate large numbers of job logs
  • Can consume significant DASD space
  • MUST be reverted after debugging is complete

⚠️ Failure to revert this configuration can result in millions of unnecessary job logs being created.

 

For QRWTSRVR (DDM/DRDA server): If an administrator wants to gather job logs for all DDM/DRDA server connections, "QZDASOINIT" can be substituted with "QRWTSRVR" in the commands below.

Steps

Understanding the LOG Parameter

The LOG parameter has three elements: LOG(level severity text)

Element 3 (Text) controls job log production:

  • *NOLIST - No job log for normal endings (code 0, 10). Job log only for abnormal endings (code ≥ 20). [Production Default]
  • *SECLVL - Job log produced for EVERY job end (with help text). [Debugging Only]
  • *MSG - Only message text (no help), no automatic job log

Steps to Enable Job Log Generation

1 Identify Current Job Description

To cause a QZDASOINIT job log to be generated, change the logging level of the QZDASOINIT jobs.

Execute the following command:

WRKACTJOB JOB(QZDASOINIT)

Take option 5=Work with, and then option 2. Display job definition attributes, on a representative QZDASOINIT job.

By default, it uses:

Job description . . . . . . . . . . . . . . . . . :  QDFTSVR
  Library . . . . . . . . . . . . . . . . . . . . :  QGPL

2 Create Custom Debug Job Description

Copy the default job description QGPL/QDFTSVR:

CRTDUPOBJ OBJ(QDFTSVR) FROMLIB(QGPL) OBJTYPE(*JOBD) TOLIB(*FROMLIB) NEWOBJ(DEBUGJOBD)

Edit the new copy to enable job log generation:

CHGJOBD JOBD(QGPL/DEBUGJOBD) LOG(4 00 *SECLVL) TEXT('TEMP DEBUG - Delete after troubleshooting')

What *SECLVL does: Causes a job log to be generated when the job ends, despite low severity ending code. This includes both message text and message help (cause and recovery information).

3 Update Prestart Job Entry

Change the QZDASOINIT prestart job entry to use the new debug job description:

CHGPJE SBSD(QUSRWRK) PGM(QZDASOINIT) JOBD(QGPL/DEBUGJOBD)

4 Apply Changes to Running Jobs

When new QZDASOINIT jobs start, they pick up the new job description and start running with the higher logging level.

Option A: Graceful Method (Recommended)

You can hasten QZDASOINIT jobs to pick up the change by executing:

WRKACTJOB JOB(QZDASOINIT)

Then press ⟨F14⟩ (or ⟨Shift⟩+⟨F2⟩) to include jobs with a status of PSRW (Pre-Start-Request-Wait).

Jobs in PSRW status are not servicing clients and can be ended at will. The subsystem automatically starts new jobs to replace them. The newly started jobs pick up the change to the Prestart job entry.

Option B: Immediate Method (Causes Disconnections)

⚠️ Warning: This option causes failure messages in all clients that are connected to the host server. Consider whether that result is acceptable.

To end and restart the database host server:

ENDPJ QUSRWRK QZDASOINIT *IMMED
STRPJ QUSRWRK QZDASOINIT

5 Verify Configuration

Verify the change took effect by taking option 5=Work with and then option 2. Display job definition attributes and ensure it is using the new job description, and has:

Message logging:
  Level . . . . . . . . . . . . . . . . . . . . . :   4
  Severity  . . . . . . . . . . . . . . . . . . . :   0
  Text  . . . . . . . . . . . . . . . . . . . . . :   *SECLVL

6 Collect Job Logs

After a client disconnects from the database host server, a job log is generated. All QZDASOINIT job logs on the system can be found with:

WRKSPLF SELECT(*ALL *ALL *ALL QZDA*)

🔴 CRITICAL: Revert Configuration After Debugging

Once the job logs are generated and you have completed your analysis, you MUST revert the configuration:

Step 1: Restore Default Job Description

CHGPJE SBSD(QUSRWRK) PGM(QZDASOINIT) JOBD(QGPL/QDFTSVR)

Step 2: Cycle Prestart Jobs

WRKACTJOB JOB(QZDASOINIT)

Press <F14> (<Shift>+<F2>) to include PSRW jobs, then end idle PSRW jobs (option 4).

Step 3: Delete Temporary Job Description

DLTJOBD JOBD(QGPL/DEBUGJOBD)

Step 4: Verify Revert

Verify new jobs are using *NOLIST:

WRKACTJOB JOB(QZDASOINIT)

Option 5, then option 2, and confirm "Text" shows *NOLIST.

⚠️ If this change is not made, many unneeded job logs can be generated, which consume space and can result in millions of unnecessary job logs.

Cleanup Generated Job Logs

After reverting the configuration, clean up unnecessary job logs:

WRKSPLF SELECT(*ALL *ALL *ALL QZDA*)

Use option 4 to delete unwanted logs, or for bulk deletion:

CLROUTQ OUTQ(library/outqname)

Additional Information

It might be necessary to generate job logs only for a certain subset of users. This action can be accomplished by combining the technique of changing the job description with a custom subsystem. For more information about using a custom subsystem, see documents:

Document Location

Worldwide

[{"Business Unit":{"code":"BU070","label":"IBM Infrastructure"},"Product":{"code":"SWG60","label":"IBM i"},"Component":"","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"All Versions","Edition":"","Line of Business":{"code":"LOB68","label":"Power HW"}}]

Document Information

Modified date:
26 August 2026

UID

ibm11168396