u/Old-Geezer-1396

▲ 0 r/IBMi

RPG Program Metrics

We recently converted a real IBM i RPG program from fixed format to free format without changing the business logic or outputs.

The program had originally been generated by AS/SET, so a normal conversion approach wasn’t enough. We modified the open-source JCRCMDS conversion tooling to recognise the AS/SET patterns, which got us to about 99.9% automated conversion. The remaining cases were just a small set of exceptions to review manually.

Maintainability Index went from 80.25 to 85.70.

What interested me more than the number was how much easier the code was to follow afterwards. The logic hadn’t changed — but you were no longer spending effort decoding fixed-format column rules while trying to understand the program.

We’ve seen something similar with complexity. On a separate 1,600-line RPG program with 27 subroutines, one subroutine had a cyclomatic complexity of 34 while the other 26 were much lower.

That’s what I keep coming back to: legacy risk often isn’t spread evenly across a program. It can be concentrated in a very small part of it.

Do you actually measure complexity/maintainability in your RPG estate, or do you mainly rely on experience and knowing which programs “feel” risky?

reddit.com
u/Old-Geezer-1396 — 7 days ago