It is really a code base issue. One of the mainframe compilers seems to have generalized ability to imply scope termination for unterminated condtionals when nested in outer conditional statements. But when that is not the case, when the explicit scope terminator is absence, the language in manuals suggest that the compiler will recover by inserting implicit scope terminators. Some of us are thinking that the problem may arise elsewhere. The implicit terminator insertion occurs when the compiler sees something that is clearly the outer statements next clause.
Expertise is needed in two areas here.
We can turn it around however, as I think you have seen discussion of already. Again gymnastics is not our goal. I could be wrong. The issue is firstly a code base issue. And then depending what if anything that puts on our menu, standard compliance for 'extensions' of this type.