End or delete threads

An initial thread, which is created when the job starts, can never be deleted or ended. However, sometimes it is necessary to end a secondary thread so that a job can continue to run. Be aware of the thread you intend to end because the job it runs within might not be able to complete without that thread's work.

Important: Ending threads should not be a part of your daily work management routine. Ending a thread is more serious than ending a job because the work in other threads might or might not stop. When you end a job, all the work stops. However, when you end a thread, only a portion of the work stops. Other threads might or might not continue to run. If they continue running without the thread that you end, they might produce undesirable results.

To delete or end a secondary thread, you must have service (*SERVICE) special authority or Thread Control authority.

Related concepts
Threads
Related information
Example: End a thread using Java
Thread management APIs

Character-based interface

Command: Work With Job (WRKJOB) Option 20: Work with threads, if active
Example: The following example displays the Work With Threads screen for the job Crtpfrdta.
WRKJOB JOB(Crtpfrdta) OPTION(*THREAD)

At the Work With Threads screen, select Option: 4=End.