Most Db2 shops run hundreds of utility jobs that were written over the years by different teams: a COPY at the end of a batch stream, a REORG with discard conditions computed the night before, a LOAD followed by a RUNSTATS. Each one runs every time it is submitted, on whatever objects it names, whether they need it or not. Bringing them under an automation framework usually means rewriting job after job, a project that is large, risky and easy to postpone forever. TUC takes control of those jobs without changing a single line of their JCL. The job runs as it always has; when it calls the utility, TUC steps in and does the work its own way.
Key Benefits
No JCL Changes — Existing utility jobs come under TUC control as they are. No step is added, removed or rewritten.
One Job at a Time — Control is switched on per job, or per group of jobs by name pattern, so the workload moves over gradually and safely.
Smarter Execution — The objects the job names are processed under TUC: only when needed, in parallel where possible, with space checked and collisions avoided.
The Batch Flow Intact — The job can wait for the work to finish, and the work can inherit the job's scheduling dependencies, so successors still start at the right moment.
Instant Fallback — A switch turns control off again, and the job goes back to running the utility directly.
Why Legacy Utility Jobs Are Hard to Automate
Utility jobs grow with the applications. Every team adds the COPY, REORG, RUNSTATS, UNLOAD or LOAD steps it needs, in its own jobs, at the points in the batch flow where they make sense to that team. Over the years the shop ends up with a large number of jobs that nobody owns as a whole.
Each of them has the same weaknesses. It processes the objects it names on every run, even when nothing has changed. It runs on its own, without knowing what else is using the objects or how much space is free. It is invisible to central control: nobody sees what it did, why, or what it cost. And it cannot simply be replaced, because other jobs in the schedule depend on it, the application team owns it, and its utility statements often carry knowledge that is written nowhere else, such as the discard conditions of a REORG or the columns of an UNLOAD.
A conversion project would have to understand, rewrite, test and reschedule every one of those jobs. Most shops never start it.
How TUC Takes Control
TUC intercepts each utility call before it reaches Db2. The jobs themselves are untouched: their JCL, their steps and their utility statements stay exactly as they are.
For each utility step, TUC checks whether a handler is enabled for the job name and the utility. A handler is the switch that tells TUC to take over:
- No handler. The utility runs immediately, exactly as before. Jobs without a handler never notice that TUC is there.
- A handler is enabled. TUC does not run the utility under the job. It places an order for the same objects, and the work is carried out under TUC control, by the same automation that runs the rest of the site's maintenance.
A handler names a utility and a job name, or a pattern that matches a whole group of jobs. A handler for COPY takes over only the COPY steps: if the same job runs a LOAD first, the LOAD runs as before and only the COPY is ordered. A specific job can also be excluded from a pattern, so that it keeps running normally while the rest of its group is taken over.
Finding the Objects Safely
Before it places an order, TUC has Db2 itself resolve the job's own utility statements, with their lists and templates, exactly as it would for the real run, and takes the objects from the result. If the statements are wrong, no order is placed, and the step ends with the same return code and the same messages the job would have produced on its own. A broken job stays visibly broken; it is never quietly converted into an order.
Keeping What the Job Knows
Utility statements often carry information that matters. TUC keeps it:
- REORG with discard conditions. The conditions, whether fixed or computed at run time, are captured for each table and applied by the ordered REORG.
- UNLOAD. The row conditions and column selection are captured, and the ordered UNLOAD produces the same output.
- LOAD. The LOAD statements, their RESUME or REPLACE options and the input datasets are kept, and the ordered LOAD reads the same input.
- Options in the statements. Choices such as unloading from the last image copy or the retention period of a copy are carried into the order.
When the original job expects the output of its step, for example the records an UNLOAD or a REORG with discard wrote, and it waits for the order to finish, TUC transfers the output into the dataset the original step would have written. The rest of the job runs unchanged.
What Changes When TUC Runs the Work
Once the objects are in an order, they are maintained like everything else under TUC:
- Only when needed. If the handler asks for it, the policy rules decide which of the named objects really need the utility, from the Db2 real-time statistics. A COPY of data that has not changed, or a REORG of an object that does not need one, is skipped.
- The right grouping. The objects are processed under the database's own maintenance profile, or under a profile chosen in the handler, with its options, templates and parallel jobs.
- Safe execution. Space is checked and reserved before the work starts, objects that are in use are not forced, and the number of concurrent jobs is governed.
- Priority. A handler can give its orders a high priority, so that work on the critical path of the batch is processed first.
- Visibility. Every order is recorded with the job that placed it, its objects, its jobs and its result, and appears in the TUC dialog and in the TUC Dashboard.
Keeping the Batch Flow Intact
A utility job in a batch stream has predecessors that must finish before it and successors that wait for it. Taking the work away from the job must not break that chain. The handler decides how the original job behaves:
- Place the order and continue. The job ends at once and the work runs independently. Suitable when nothing waits for the utility.
- Wait for completion. The job waits until the order has finished, and ends with a return code that tells completed work from held or failed work. How long it waits is set from earlier runs of the same work. Successors start only when the work is really done.
- Wait for scheduling. The job waits only until the order has been scheduled, so that dependencies can be attached to it.
- Collect objects from several jobs. The order waits a short time for other jobs to add their objects, so that many small legacy jobs that each process one object become one order with a common point of consistency.
A handler can also make the order follow the job's scheduling dependencies. TUC reads the predecessors and successors of the original job from TWS and adds the same dependencies to the jobs of the order, so successors wait for the order exactly as they waited for the original utility. When several jobs add objects to one order, the dependencies of all of them are followed. A dependency that turns out to delay the work can be removed from the order by the DBA.
A Gradual, Reversible Move
Because each handler covers one utility and one job or pattern of jobs, the move to automation can be as gradual as the site wants. A typical path starts with a handful of non-critical COPY jobs, places their orders without waiting, and watches the results. Once the team is confident, it adds the REORG and RUNSTATS jobs, switches on the policy rules so that only the objects that need it are processed, and lets the critical jobs wait for their orders and pass on their dependencies.
Every handler can be enabled and disabled, one at a time or all together. Disabling a handler returns the job to running the utility directly, at once and with no change to the job. The list of jobs that match each handler and the orders each handler has placed are always on screen, so the team can see exactly what has moved and what has not.
Without and With TUC
| Task | Rewriting the Jobs | With TUC Handlers |
| Changing the JCL | Every job rewritten, tested and rescheduled. | No change to any job. |
| Moving over | A project for the whole workload at once. | One job or job pattern at a time. |
| Objects that do not need it | Processed on every run. | Skipped by the policy rules, if the handler asks for it. |
| Discard, unload and load logic | Rewritten into the new jobs. | Captured from the job's own statements at run time. |
| Successor jobs | Rescheduled one by one. | Wait for the order, or follow the dependencies it inherits. |
| Going back | Restore the old jobs. | Disable the handler. |
| Visibility | Scattered job output. | Every order recorded, in the dialog and the dashboard. |
In short — TUC handlers bring existing Db2 utility jobs under central, intelligent control without changing their JCL. The job runs as it always did; TUC takes over the utility, runs it only where it is needed and in the best way, keeps the batch flow intact, and can hand control back at any moment.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article