Control Breaks and Sanity

Charlie Massoglia, a well-known author in RPG circles, as well as the owner of his own consulting firm and past president of COMMON (a prominent IBM midrange user group) once wrote a series of articles introducing RPGIV to the world. In one of them he said: “Contrary to conventional wisdom, our shop does use control level indicators for reports since there is no easier way to produce subtotals and we have found negligible performance differences between input primary and full procedural files.” He acknowledged that he was likely a minority holder of the opinion when he followed the above remark and prefaced further discussion by saying, “Without getting into a debate about whether or not control level indicators should be used…”

A discussion of control breaks (or level breaks) almost always ends up in controversy. Even though control breaks, as part of the RPG cycle, have been part of the language, and very commonly used from the start, many RPG programmers don’t have a clue as to how the cycle functions, or even any reason why a programmer would even want it. It often goes beyond a intellectual discussion of merits and demerits of automatic level break handling by the cycle. Most RPG authorities would say that the less said about them the better. Bob Cozzi, an RPG authority, probably says that the “modern” RPG programmer does not use the cycle, though I haven’t looked at his classic “The Modern RPG Language” in a while, so I can’t be sure.

The divide seems to be at the System/38. If a programmer got his initial experience using RPGII on the System/3, System/34 or System/36, in my observation they have absolutely no problem understanding the RPG cycle and think handling level breaks using the cycle is the obvious way to go; If they started their RPG experience with RPG with RPGIII on the System/38 or RPG/400 or RPG IV on the AS/400, the cycle is mind-boggling and those who use it are demented.

Forum discussions of the RPG cycle often deteriorate into name-calling, generally at the expense of the old guard, who should just retire so the real programmers can fix what they did. It becomes almost a religious issue. Once I just brought up to someone the subject of level breaks using the cycle, not even arguing in favor of it, and by his tone of voice in reaction you would have thought I was suggesting I wanted forcible carnal knowledge of his sister.

I find that some authors will admit in forum entries that RPG using the cycle makes sense at least in some circumstances, even though their full blown books will consign discussion of it to an appendix entry.

Level breaks, as described above, are linked tightly to the RPG cycle. Until recently, all RPG programs use the RPG cycle automatically; however, most “modern” RPG programs tend to try to make believe that the cycle doesn’t exist. The one who wants to ignore the cycle will use a repeated READ or READE statement to read a file or a subset of it. The one who uses the cycle does not need to do this, assuming his main focus is reading a single file (or multiple files) from start to finish. (This programmer may use READ or CHAIN opcodes to read files subsidiary to the main file being read.).

For this reason, I will reserve a further discussion of level breaks until I discuss the RPG cycle. This will involve an interesting discussion of programmer psychology and why programmers sometimes reject useful techniques for the sake of an ideology.

Leave a Reply