OPERATIONS

When a Batch Job Abends: Recovering VSAM Files in Minutes, Not Hours

A batch step abends halfway through a 400,000-record posting run. Some records are updated, some are not, and the program has no idea which. It is 2 a.m. What happens next decides whether the morning starts on time.

For most shops, it depends on who is on call and how good the runbook is. Recovery should not depend on either. It should be a step in the job.

Why Restore and Rerun Stopped Working

The traditional fix is a point-in-time restore from the backup taken before the job, followed by a rerun. That works when CICS was down and nobody else touched the files. The moment CICS stays up during batch, which is the whole point of file sharing, a restore throws away every online transaction entered since the backup.

That leaves two bad choices. Lose the online work, or hold CICS in inquiry-only mode while someone reconstructs the file by hand. One Fortune 100 retirement services provider lived with 45 to 90 minutes of inquiry-only mode per abend, plus calls to the command center, the national call center, and several other groups every time it happened. Boston College found that its previous solution could not tell whether CICS had changed a file since the backup, so staff had to work out which files to recover before they could recover anything.

The Four Ways to Recover

Restore from a pre-job backup and rerun. Online updates are lost. Recovery takes hours, longer when several files are involved.

Manual record repair. Staff identify and fix the records batch touched. Online updates survive if nobody makes a mistake. Expect 45 to 90 minutes with CICS in inquiry-only mode.

Application restartability. Programs checkpoint and restart from the last commit. This is fast and preserves online work, but only for programs that were coded for it and tested. A checkpoint routine nobody has exercised since 2009 does not count.

Journaled backout through CICS. Every batch I/O is logged. A backout step reverses the uncommitted unit of work and leaves online updates in place. Recovery takes seconds to a few minutes, and users never notice.

The fourth method is what CICS already does for online transactions. The question is how to extend it to batch.

How SYSB-II Makes Journaled Backout the Default

Because SYSB-II routes batch VSAM requests through CICS file control, every batch update to a shared file is journaled with the online updates. When a job abends, the SYSB-II backout step reverses the batch updates in the failed unit of work and leaves online work untouched. Most sites automate it with a condition-code step in the JCL, so the backout has already run before anyone is paged. Syncpoints, which SYSB-II can take at a configurable record interval without code changes, keep units of work small, so backout is fast and locks are short.

For files that batch accesses natively rather than through CICS, SYSB-II can journal that I/O as well, so a single backout covers the whole job. That was the change TIAA made. Their senior systems programmer describes the result: if the batch job abends, the SYSB-II backout step executes automatically. Staff identify the bad record in 15 to 30 seconds, and within five minutes the job is rerun past the bad data while users keep keying and posting transactions. Standard Life’s team put it another way: the difference between being up half the night and being up for 20 minutes.

For how this recovery model differs from VSAM RLS and DFSMStvs, see SYSB-II, VSAM RLS, and DFSMStvs: What Is the Difference?

Check Your Own Runbook

List the batch jobs that update VSAM files CICS also uses. For each one, write down today’s recovery procedure and how long it took the last time it ran for real, not in a drill.

Count how many of those programs have tested restartability. Note which files are defined as recoverable in CICS; those already have forward-recovery logs you can build on.

Then decide what recovered means to the business. File restored, or online users never interrupted? The second definition is the one your service levels almost certainly assume. Measure your current recovery time against it.

Boston College bought SYSB-II for daytime updates and discovered the recovery benefit afterward. Standard Life installed it on QA and test regions as well, so developers back out and rerun test scenarios in minutes instead of waiting for a systems programmer to restore the environment.

Two other posts look at recovery from different angles: Recovery Is the SYSB-II Benefit Too Many Teams Underestimate and Why Recovery Should Be Part of the File Sharing Conversation from Day One.

The SYSB-II FAQ covers recovery and the other questions teams ask most about SYSB-II.

About H&W

H&W has been helping our customers solve this issue for over 30 years. To talk with us about your situation: