Intro

What exactly must be recalculated when bytes inside an IBM i save file are modified?

IBM i save files, usually called SAVFs, use two container-consistency checksum mechanisms. Every 512-byte payload has a 16-byte trailer, and the logical stream also carries a 16-byte global checksum in its final payload. I wanted to understand both mechanisms well enough to reproduce them, modify a SAVF, and repair only the bytes that depended on my change.

For the reconstruction, I used a small IBM-generated SAVF and the publicly distributed jSAVF reader, whose JAR I decompiled. I reimplemented both algorithms in Python and reproduced every stored checksum in the original file. A second file contained three changed payload bytes and a stale global checksum. Repairing that container changed only the global-checksum field and the final record trailer. I also found the global algorithm’s table and adjacent constants in IBM i Licensed Internal Code (LIC) installation media.