COBOL Manual for TNS/E Programs (H06.03+)
Source Program Organization and Format
HP COBOL Manual for TNS/E Programs—520347-003
2-17
Shared Data
Example 2-2. Programs With Shared Data (page 1 of 4)
* _______________________________________________________________________
* | Program: Mane |
* | Data: w (local to Mane) |
* | y (global throughout Mane and its descendants) |
* | z (global throughout Mane and its descendants, and external) |
* | Can call: Aaa, Bbb because both are directly contained |
* | _________________________________________________________________ |
* | | Program: Aaa | |
* | | Data: none | |
* | | Can call: Bbb because Bbb is common | |
* | | Sub because Sub is separate unit | |
* | |_________________________________________________________________| |
* | | Program: Bbb (common) | |
* | | Data: w (external) | |
* | | x (global throughout Bbb) | |
* | | Can call: Ccc because Ccc is directly contained | |
* | | Sub because Sub is separate unit | |
* | | ____________________________________________________ | |
* | | | Program: Ccc | | |
* | | | Data: w (external) | | |
* | | | y (local to Ccc) | | |
* | | | Can call: Ddd because Ddd is directly contained | | |
* | | | Sub because Sub is separate unit | | |
* | | | ______________________________________________ | | |
* | | | | Program: Ddd | | | |
* | | | | Data: none | | | |
* | | | | Can call: Sub because Sub is separate unit | | | |
* | | | |______________________________________________| | | |
* | | |___________________________________________________| | |
* | |_________________________________________________________________| |
* |_______________________________________________________________________|
* | Program: Sub |
* | Data: w (external) |
* | x (local to Sub) |
* | y (global throughout Sub and any descendants) |
* | z (global throughout Sub and any descendants, and external) |
* | Can call: no other routines (calling Mane would be recursion) |
* |_______________________________________________________________________|










