Online utilities (LOAD, REORG, COPY, RECOVER, RUNSTATS, and the rest of the IBM Utility Suite) register a utility ID with DB2. If that job is hung, looping, or waiting on a drain you will never get, the operator command is -TERM UTILITY. This page covers the only command in the TERM family on z/OS, how to name UIDs, who is allowed to issue it, data sharing rules, and what TERM does to each utility type.
-TERM UTILITY (abbreviation -TER UTIL) terminates execution of a Db2 utility job step and releases all resources associated with that step. An active utility does not stop until it periodically checks whether TERM was issued. A stopped utility (already interrupted) has its remaining Db2 resources released when you TERM it.
Issue the command from a z/OS console, DSN session, DB2I COMMANDS or DB2 UTILITIES panels, an IMS or CICS terminal, or IFI. Message DSN9022I is normal completion.
Scope is member or group depending on state:
DISPLAY UTILITY with MEMBER(member-name) helps you see which member owns the job before you TERM from the wrong prefix.
You may TERM a utility if you are using the primary or a secondary authorization ID of the process that originally submitted the job, or if your privilege set includes one of:
For utilities on objects in implicitly created databases, the database privilege may be held on that database or on DSNDB04. Ownership of the table spaces or index spaces is also sufficient when the command names those spaces. DIAGNOSE, REPORT, and STOSPACE can be terminated only by the original submitter or by SYSOPR, SYSCTRL, or SYSADM.
Database DSNDB06 holds the catalog spaces used to check authorization. If a utility is running against a catalog/directory space required for that check, you need installation SYSADM to terminate it.
You must specify one of:
Default UID from the EXEC of DSNUTILB is userid.jobname. Default from the DSNU CLIST is tso-userid.control-file-name. Always DISPLAY UTILITY first so you TERM the UID you think you are terminating—prefix wildcards are powerful and easy to over-use.
1234-DISPLAY UTILITY(*) -TERM UTILITY(*) -TERM UTILITY(SMITH*) -TERM UTILITY(PAYREORG.STEP1)
This is the sentence shops forget: a terminated utility job step cannot be restarted. RESTART(CURRENT) or RESTART(PHASE) applies to a utility that stopped (abend, cancel of the job after a controlled stop, or a condition the Utility Guide allows you to restart). After TERM, you resubmit as a new utility execution. Decide before you TERM whether you wanted restart or a true throw-away.
IBM documents special effects for several utilities. Where the Command Reference lists “none,” TERM still ends the job and releases utility resources; objects may already have been left in a state by the phase that was running.
| Utility | Special effect of TERM |
|---|---|
| CATENFM | None special documented |
| CATMAINT | Places indexes in REBUILD-pending status |
| CHECK DATA | Table spaces remain in CHECK-pending status |
| CHECK INDEX | None special documented |
| CHECK LOB | Places LOB table spaces and indexes in UTRO (utility read-only) |
| COPY | Inserts a T record in SYSIBM.SYSCOPY; COPY will not allow an incremental image copy while that T record exists |
| DIAGNOSE / MERGECOPY / MODIFY RECOVERY / MODIFY STATISTICS / QUIESCE / REPAIR / REPORT / RUNSTATS / STOSPACE | None special documented for TERM itself |
| REBUILD INDEX | Object being rebuilt is placed in REBUILD-pending |
| RECOVER (utility) | Object being recovered is placed in RECOVER-pending |
| UNLOAD | Output data set remains incomplete until you restart (not allowed after TERM) or delete the data set |
| LOAD / REORG INDEX / REORG TABLESPACE | Phase-dependent restrictive states are common (RECP, RBDP, and related). DISPLAY DATABASE and consult the Utility Guide for the phase shown on DISPLAY UTILITY before you TERM. |
After TERM, DISPLAY DATABASE for RECP, RBDP, CHKP, UTRO, and related statuses. COPY’s T SYSCOPY record is easy to miss: your next incremental COPY fails until you take a full image copy. UNLOAD’s output file is not a complete unload—delete it rather than feeding it to LOAD.
Practical sequence for a stuck REORG: DISPLAY UTILITY (phase, UID, member), DISPLAY DATABASE CLAIMERS, attempt ALTER UTILITY if you only need to change drain behavior, TERM UTILITY if the job must die, DISPLAY DATABASE for pending, then a new REORG or RECOVER/REBUILD as the pending state requires.
A utility is a construction crew with a work order number (the UID) taped to the library door. TERM UTILITY is the manager tearing up that work order and sending the crew home. You cannot tell them “continue tomorrow from page 47”—you have to issue a brand-new work order. Sometimes they leave wet paint (RECP/RBDP) that another crew must finish. DISPLAY UTILITY is reading the work order number before you tear it up so you do not send the wrong crew home.
1. Can you restart a utility after TERM UTILITY?
2. Who can terminate a utility besides the original submitter?
3. Can you TERM an active utility from another data sharing member?
4. What does TERM UTILITY(SMITH*) do?
5. Why might TERM UTILITY require installation SYSADM?