Skaloop
Agnostic atheist, pro-choice anti-abortion
- May 10, 2006
- 16,332
- 899
- 48
- Faith
- Atheist
- Marital Status
- Married
- Politics
- CA-NDP
I had no idea you were a programmer. When you start using nested hierarchy your programs will gain a lot of utility.
Simple linear programs can accomplish some work, but very little. A LOOP will help you out a lot.
In your example, you'll get a pizza with one sausage and one tomato slice and one mushroom.
You could add two lines of code and get double servings of cheese.
Calling Nested Programs
Nested programs give you a method to create modular functions for your application and maintain structured programming techniques. Nested programs allow you to define multiple separate functions, each with its own controlled scope, within a single compilation unit. They can be used like PERFORM procedures with the additional ability to protect local data items.
Nested programs are contained in the same module as their calling program when they are compiled. Therefore, nested programs always run in the same activation group as their calling programs.
Structure of Nested Programs
An ILE COBOL program may contain other ILE COBOL programs. The contained programs may themselves contain yet other programs. A contained program may be directly or indirectly contained within a program.
Figure 51 describes a nested program structure with directly and indirectly contained programs.
Figure 51. Nested Program Structure with Directly and Indirectly Contained Programs
Help -Calling Nested Programs
Nested programs do not form a nested hierarchy. A single nested program surely can, but not all programs form a nested hierarchy the way all life does. Just because the two terms have the word "nested" in them does not make them analogous.
Upvote
0