GnuCOBOL – On Size Error

Because of my research into the state population problem, I decided I needed to alter some old GnuCOBOL control break programs, to summarize the number of customers by state. These programs kept triggering On Size Error, no matter how high I bumped the picture clause. . I remembered I assumed it was a bug. However I recently updated GnuCOBOL, and decided I needed to look further into it.

So it was fairly easy to confirm that the On Size Error feature, was working properly. I simply created a small COBOL program, that looped and added one to a 3 digit field 1005 times. And sure enough, I only got the error 6 times, on values 1000-1005.

So as unlikely as it seems, there must be some logic problem with my program… and not the compiler 🙂 The home page states…

Also I think I have a understanding problem with SORT INPUT PROCEDURE/OUTPUT PROCEDURE… it’s been a while.

Maybe look here, here and here.