Rule Definition
Nested programs are not visible among the source files. In addition, if there are several occurrences of the same nested subprograms, then the maintenance tasks may be difficult and it is easy to forget one of these occurrences. Then, incoherences can occur during the application execution.
Remediation
If there are several occurrences of the same nested program, then replace them by an external subprogram. Try to use external subprograms as much as possible.
Violation Code Sample
000700 Identification Division.
000800 Program-Id. MAINPGM.
000900 Procedure Division.
001000 Display "I am in MAINPGM".
001100 Call "NEST1".
001300 Goback.
001400**************************************************
001500*** NEST1 is directly contained in MAINPGM ***
001700**************************************************
001800 Identification Division.
001900 Program-Id. NEST1.
002000 Procedure Division.
002100 Display "I am in NEST1".
002400 GoBack.
004500 End Program NEST1.
005500 End Program MAINPGM.
Related Technologies
Cobol
Technical Criterion
Programming Practices - Structuredness
About CAST Appmarq
CAST Appmarq is by far the biggest repository of data about real IT systems. It's built on thousands of analyzed applications, made of 35 different technologies, by over 300 business organizations across major verticals. It provides IT Leaders with factual key analytics to let them know if their applications are on track.