Find unreachable paragraphs and sections
ProprietaryFind paragraphs and sections that no path from the program's entry point reaches, by building a control flow graph over the procedure division and walking it. The graph follows GO TO including DEPENDING ON, PERFORM including the full THRU range, the procedures SORT, MERGE and XML PARSE run, and the branch targets registered by EXEC CICS HANDLE, and the branch EXEC SQL WHENEVER adds to each SQL statement written after it. A PERFORM returns at the end of what it performed, so control falls from one paragraph into the next only where no PERFORM returns. XCTL, RETURN and ABEND end the program. Programs containing ALTER are skipped, because ALTER retargets a GO TO at run time and leaves the program with no static control flow. So are programs whose procedure division copies a member that could not be found, since its statements could transfer anywhere.
io. moderne. mainframe. analysis. controlflow. FindUnreachableProceduresmod run . --recipe= io. moderne. mainframe. analysis. controlflow. FindUnreachableProceduresInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.