This is correct : Cobol -85.
This is not correct: for CICS only, as it is COBOL STANDARD, it is valid for all programs.
Nested programs is a way of structuring a program in different programs instead of having paragraphs. A mixture is probably most common.
Nested programs makes it possible to have separate Working-Storage Sections for each program, thus (1) hiding/protections data and (2) no need for unique names, each contained program is a comletely separate program. You may call the nested programs with parameters, as always, which you cant when using paragraphs, BUT you can also expose variables from the outer program, My-Program, so they are available in the other, contained, programs, by marking the 01 or 77 level as GLOBAL.
A small example, but more details to read in the manual of course!
Id Division.
Program-Id. My-Program.
Working-Storage Section
77 My-Global-Data Pic xxxx GLOBAL.
01 Param1.
. . .
Procedure Division
. . .
Call 'My-Nested-Program1' Using Param1
Call 'My-Common-Program'
* This call is valid only if the called program has the COMMON attribute
* as it is not a direct contained program. It is contained in the
* My-Nested-Program1
. . .
GoBack
.
Id Division.
Program-Id. My-Nested-Program1.
Working-Storage Section
Linkage Section.
01 Param1.
. . .
Procedure Division Using Param1.
. . .
* No declaration needed here
If My-Global-Data......
Call 'My-Common-Program'
* This call would have been valid without the COMMON attribute, since it is a direct contained program.
. . .
GoBack
.
Id Division.
Program-Id. My-Common-Program Is COMMON.
Working-Storage Section
. . .
. . .
Procedure Division
. . .
. . .
. . .
GoBack
End Program My-Common-Program.
End Program My Nested-Program1.
End Program My-Program.