Suppose, for example, that the program says:
PERFORM 3690-SEARCH-USOC THRU 3690-EXIT.This THRU clauses is useless, and hence trivial, if all of the following conditions apply:
These transformations are safe because they do not disrupt any other instance of fall-through logic.
PERFORM 3690-SEARCH-USOC THRU 3690-EXIT.
...
3690-SEARCH-USOC.
*
* do stuff here
*
GO TO 3690-EXIT.
*
3690-EXIT.
EXIT.
In this case you must remove not only the THRU clause but also
the GO TO.
The original spaghetti code probably won't look like this. In a later stage of transformation, however, you may insert GO TOs like this in order to eliminate fall-through logic.
Before you remove a THRU clause, verify that it meets all three of the above conditions. Otherwise you'll find an unpleasant surprise sooner or later.
In particular, beware of code like the following:
PERFORM 3690-SEARCH-USOC THRU 3960-EXIT.This code could be a mistake, or it could be an example of a serial THRU clause. It might even be a trivial THRU clause combined with careless paragraph names. If you're not careful, though, it will slip right past your eyeballs. You'll mindlessly delete the THRU clause, possibly with unexpected consequences.